mirror of https://github.com/docker/docs.git
hugo: generate metadata.json index
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
9ea2034b6a
commit
814e301375
11
hugo.yaml
11
hugo.yaml
|
@ -57,6 +57,11 @@ outputFormats:
|
|||
isPlainText: true
|
||||
mediaType: "application/json"
|
||||
notAlternative: true
|
||||
metadata:
|
||||
baseName: metadata
|
||||
isPlainText: true
|
||||
mediaType: "application/json"
|
||||
notAlternative: true
|
||||
robots:
|
||||
baseName: robots
|
||||
isPlainText: true
|
||||
|
@ -67,12 +72,8 @@ outputs:
|
|||
home:
|
||||
- html
|
||||
- redirects
|
||||
- metadata
|
||||
- robots
|
||||
term:
|
||||
- html
|
||||
- json
|
||||
|
||||
taxonomies:
|
||||
|
||||
languages:
|
||||
en:
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
[
|
||||
{{- range where site.Pages "Params.sitemap" "!=" false -}}
|
||||
{{- $title := partialCached "utils/title.html" . . -}}
|
||||
{{- $desc := partialCached "utils/description.html" . . -}}
|
||||
{{- $kwd := partialCached "utils/keywords.html" . . -}}
|
||||
{{- jsonify (dict "url" .Permalink "title" $title "description" $desc "keywords" $kwd) -}},
|
||||
{{- end -}}
|
||||
{}]
|
|
@ -1,12 +1,11 @@
|
|||
{{ $keywords := "" }}
|
||||
{{ if .Keywords }}
|
||||
{{ $keywords = .Keywords }}
|
||||
{{ $keywords = strings.Split (collections.Delimit .Keywords " ") ", " }}
|
||||
{{ else }}
|
||||
{{ $keywords = "docker, docker open source, docker platform, distributed applications, microservices, containers, docker containers, docker software, docker virtualization" }}
|
||||
{{ with .File }}
|
||||
{{ with (index (site.Data.frontmatter) .Path) }}
|
||||
{{ with .keywords }}
|
||||
{{ $keywords = strings.Replace . "\n" " " | strings.TrimRight " " }}
|
||||
{{ $keywords = strings.Split (strings.Trim . "\n") ", " }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue