mirror of https://github.com/docker/docs.git
hugo: improve templating for keywords and descriptions
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
0ca7526092
commit
a56d652fdd
|
|
@ -1,6 +1,6 @@
|
||||||
{{ $desc := "" }}
|
{{ $desc := "" }}
|
||||||
{{ if .Description }}
|
{{ if .Description }}
|
||||||
{{ $desc = .Description }}
|
{{ $desc = strings.Replace .Description "\n" " " }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .File }}
|
{{ with .File }}
|
||||||
{{ with (index (site.Data.frontmatter) .Path) }}
|
{{ with (index (site.Data.frontmatter) .Path) }}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
{{ $keywords := "" }}
|
{{ $keywords := "" }}
|
||||||
{{ if .Keywords }}
|
{{ if .Keywords }}
|
||||||
{{ $keywords = strings.Split (collections.Delimit .Keywords " ") ", " }}
|
{{ $keywords = delimit .Keywords " " }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .File }}
|
{{ with .File }}
|
||||||
{{ with (index (site.Data.frontmatter) .Path) }}
|
{{ with (index (site.Data.frontmatter) .Path) }}
|
||||||
{{ with .keywords }}
|
{{ with .keywords }}
|
||||||
{{ $keywords = strings.Split (strings.Trim . "\n") ", " }}
|
{{ $keywords = strings.Replace (strings.Trim . "\n") "\n" " " }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue