fix(layouts): resolve accessibility and SEO issues from AI crawler support (#830)

This commit is contained in:
Cell
2026-08-17 12:47:50 +08:00
committed by GitHub
parent 8782b46f53
commit e0940bd4d3
6 changed files with 91 additions and 1 deletions
+18
View File
@@ -19,6 +19,24 @@
<meta name="author" content="{{ $author.name }}">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage | and .Summary }}{{ .Summary | plainify }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
{{- /* Robots meta tag: respect page-level robots frontmatter; default to index,follow with max-image-preview:large only when cover exists */ -}}
{{- if isset .Params "robots" -}}
<meta name="robots" content="{{ .Params.robots }}">
{{- else -}}
{{- $hasCover := false -}}
{{- if .IsHome -}}
{{- $hasCover = isset .Site.Params.seo "cover" -}}
{{- else if .IsPage -}}
{{- $cover := dict "Page" . | partial "function/get-cover.html" -}}
{{- $hasCover = or $cover.Source $cover.Matches -}}
{{- end -}}
{{- if $hasCover -}}
<meta name="robots" content="index, follow, max-image-preview:large">
{{- else -}}
<meta name="robots" content="index, follow">
{{- end -}}
{{- end -}}
{{- $keywords := .Keywords -}}
{{- if not $keywords -}}
{{- if .IsPage | and .Params.tags -}}