Back to Docker

Keywords

layouts/_partials/utils/keywords.html

18.09-release684 B
Original Source

{{- /* 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 }}