Skip to content

Commit

Permalink
hidden pages: hide search index matcornic#102
Browse files Browse the repository at this point in the history
if user disabled SEO or search
  • Loading branch information
McShelby committed Sep 27, 2021
1 parent 5d98f7d commit 7f0057b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions layouts/partials/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
{{- else }}
{{- range .AlternativeOutputFormats }}
{{- if ne .Name "JSON" }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{- end }}
{{- end }}
{{- end }}
{{- if and (ne .Site.Params.disableSeoHiddenPages true) (ne .Site.Params.disableSearchHiddenPages true) }}
{{- range .AlternativeOutputFormats }}
{{- if eq .Name "JSON" }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{- end }}
{{- end }}
{{- end }}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{- with .Site.Params.author }}
Expand Down

0 comments on commit 7f0057b

Please sign in to comment.