From 87f97e55bbab2e23359fa3e68e65ae6ce93a90e1 Mon Sep 17 00:00:00 2001
From: Regis Philibert <login@regisphilibert.com>
Date: Wed, 02 Feb 2022 18:42:05 +0000
Subject: [PATCH] Allow certain pages to not be indexed by SE

---
 layouts/_default/baseof.html |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index dc5e33b..1a7f2c7 100755
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -9,10 +9,12 @@
     <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
     {{ hugo.Generator }}
     {{/* 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")  }}
-      <META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
+    {{ $production := eq (getenv "HUGO_ENV") "production" | or (eq site.Params.env "production") }}
+    {{ $public := not .Params.private }}
+    {{ if and $production $public }}
+      <meta name="robots" content="index, follow">
     {{ else }}
-      <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
+      <meta name="robots" content="noindex, nofollow">
     {{ end }}
 
     {{ partial "site-style.html" . }}

--
Gitblit v1.10.0