Allow certain pages to not be indexed by SE

Fixes #499
This commit is contained in:
Regis Philibert 2022-02-02 13:42:05 -05:00
parent 5de8db332c
commit 87f97e55bb
2 changed files with 9 additions and 3 deletions

View file

@ -187,6 +187,10 @@ Here is the list of built-in services. Those marked with an `*` are also part of
In order to add an unkown service (absent from the list above), you simply need to add all three settings to `ananke_socials`: name, url, label, color, and optionally add an icon file matching the `name` to the `assets/ananke/socials` directory. In the absence of an icon, the theme will print the service's label. In order to add an unkown service (absent from the list above), you simply need to add all three settings to `ananke_socials`: name, url, label, color, and optionally add an icon file matching the `name` to the `assets/ananke/socials` directory. In the absence of an icon, the theme will print the service's label.
### Content indexing
If the theme is ran in [production](#production), pages will be indexed by search engines. To prevent indexing on some given pages, add `private: true` to its Front Matter.
### Update font or body classes ### Update font or body classes
The theme is set, by default, to use a near-white background color and the "Avenir" or serif typeface. You can change these in your config file with the `body_classes` parameter, like this: The theme is set, by default, to use a near-white background color and the "Avenir" or serif typeface. You can change these in your config file with the `body_classes` parameter, like this:

View file

@ -9,10 +9,12 @@
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"> <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
{{ hugo.Generator }} {{ hugo.Generator }}
{{/* NOTE: For Production make sure you add `HUGO_ENV="production"` before your build command */}} {{/* NOTE: For Production make sure you add `HUGO_ENV="production"` before your build command */}}
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} {{ $production := eq (getenv "HUGO_ENV") "production" | or (eq site.Params.env "production") }}
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW"> {{ $public := not .Params.private }}
{{ if and $production $public }}
<meta name="robots" content="index, follow">
{{ else }} {{ else }}
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> <meta name="robots" content="noindex, nofollow">
{{ end }} {{ end }}
{{ partial "site-style.html" . }} {{ partial "site-style.html" . }}