mirror of
https://github.com/docker/docs.git
synced 2026-03-27 22:38:54 +07:00
- layouts/partials/ → layouts/_partials/ - layouts/shortcodes/ → layouts/_shortcodes/ - layouts/_default/_markup/ → layouts/_markup/ - layouts/_default/*.html → layouts/*.html (flatten _default/) - layouts/index.html → layouts/home.html - layouts/index.*.json/txt → layouts/home.*.json/txt - layouts/_default/index.llms.txt → layouts/home.llms.txt - layouts/tag/ → layouts/tags/ (match /tags/ URL path)
20 lines
725 B
HTML
20 lines
725 B
HTML
{{- /*
|
|
Utility template to extract keywords for the current page.
|
|
- Uses `.Keywords` if available or falls back to front matter in `site.Data.frontmatter`.
|
|
- Cleans and trims keywords, joining them into a comma-separated string.
|
|
- Intended for reuse in meta tags or other keyword-based contexts.
|
|
*/ -}}
|
|
{{ $keywords := "" }}
|
|
{{ if .Keywords }}
|
|
{{ $keywords = collections.Apply .Keywords "strings.Trim" "." ", " }}
|
|
{{ else }}
|
|
{{ with .File }}
|
|
{{ with (index (site.Data.frontmatter) .Path) }}
|
|
{{ with .keywords }}
|
|
{{ $keywords = collections.Apply (strings.Split (strings.Replace . "\n" " ") ",") "strings.Trim" "." " " }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ return $keywords }}
|