diff --git a/content/en/history/bibliography/_index.md b/content/en/history/bibliography/_index.md index 4a499831..b9c2823f 100644 --- a/content/en/history/bibliography/_index.md +++ b/content/en/history/bibliography/_index.md @@ -2,6 +2,7 @@ title: Bibliography heading: Interlisp Bibliography type: bibliography +robots: "noindex, follow" cascade: type: bibliography toc_hide: true diff --git a/layouts/_partials/hooks/head-end.html b/layouts/_partials/hooks/head-end.html index f800ce9f..14f526e3 100644 --- a/layouts/_partials/hooks/head-end.html +++ b/layouts/_partials/hooks/head-end.html @@ -1,3 +1,11 @@ +{{- /* Emit a page-level robots directive when front matter sets `robots`. + Docsy's head.html already emits "index, follow" for production pages; + when both tags are present, search engines apply the most restrictive + rule, so a `noindex` value here wins. See the bibliography section's + _index.md. */ -}} +{{ with .Params.robots }} + +{{ end }} {{ partial "bibliography-json-ld.html" . }} diff --git a/layouts/bibliography/list.html b/layouts/bibliography/list.html index 68cd602d..47b6334b 100644 --- a/layouts/bibliography/list.html +++ b/layouts/bibliography/list.html @@ -107,9 +107,9 @@

{{ or .Params.heading .Title }}

{{- $previewing := gt (countwords $plain) $previewWordLimit -}} {{- if $previewing }} {{- $previewWords := split $plain " " | first $previewWordLimit -}} -
{{ delimit $previewWords " " | safeHTML }}…
+
{{ delimit $previewWords " " | safeHTML }}…
{{- else }} -
{{ replace (. | htmlEscape) "\n" "
" | safeHTML }}
+
{{ replace (. | htmlEscape) "\n" "
" | safeHTML }}
{{- end }} {{ end }} diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml index 226bee19..ab0b33f6 100644 --- a/layouts/sitemap.xml +++ b/layouts/sitemap.xml @@ -2,6 +2,7 @@ {{ range (where .Data.Pages "Type" "!=" "redirect") }} + {{- if not (strings.Contains (.Params.robots | default "") "noindex") }} {{ .Permalink }}{{ if not .Lastmod.IsZero }} {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} @@ -18,5 +19,6 @@ href="{{ .Permalink }}" />{{ end }} + {{- end }} {{ end }}