From 2519452f2409a4eeabdf48058771756b9352fcef Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Sun, 16 Oct 2022 08:41:44 -0700 Subject: [PATCH] Exclude consulting thank you page from sitemap and robots.txt --- content/consulting-thankyou.md | 1 + layouts/_default/.keep | 0 layouts/_default/sitemap.xml | 25 +++++++++++++++++++++++++ layouts/robots.txt | 2 ++ static/robots.txt | 2 -- 5 files changed, 28 insertions(+), 2 deletions(-) delete mode 100644 layouts/_default/.keep create mode 100644 layouts/_default/sitemap.xml create mode 100644 layouts/robots.txt delete mode 100644 static/robots.txt diff --git a/content/consulting-thankyou.md b/content/consulting-thankyou.md index 7704020..ff2241c 100644 --- a/content/consulting-thankyou.md +++ b/content/consulting-thankyou.md @@ -6,6 +6,7 @@ showReadTime = false showDate = false showShare = false comments = false +sitemap_exclude = true +++ Thank you for contacting me. I have received your submitted form for booking a consultation. I will be in touch shortly. diff --git a/layouts/_default/.keep b/layouts/_default/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml new file mode 100644 index 0000000..d368c04 --- /dev/null +++ b/layouts/_default/sitemap.xml @@ -0,0 +1,25 @@ +{{ printf "" | safeHTML }} + + {{ range where .Data.Pages "Params.sitemap_exclude" "ne" true }} + {{- if .Permalink -}} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + + {{- end -}} + {{ end }} + + diff --git a/layouts/robots.txt b/layouts/robots.txt new file mode 100644 index 0000000..3fe2f9d --- /dev/null +++ b/layouts/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /consulting-thankyou diff --git a/static/robots.txt b/static/robots.txt deleted file mode 100644 index 54fb989..0000000 --- a/static/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -