From 2696466e0edb9105b839d00677e8ab9e26215fc3 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 21 Sep 2016 22:25:36 +0300 Subject: [PATCH] Add robots.txt template to disallow robots See: https://github.com/spf13/hugo/blob/master/docs/content/extras/robots-txt.md --- config.toml | 1 + layouts/robots.txt | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 layouts/robots.txt diff --git a/config.toml b/config.toml index 39876b167..02e9b4089 100644 --- a/config.toml +++ b/config.toml @@ -5,6 +5,7 @@ languageCode = "en-us" title = "CGSpace Notes" newContentEditor = "vim" theme = "hugo-theme-bootstrap4-blog" +enableRobotsTXT = true [permalinks] # use 2016-09 as slug, since my posts are always monthly diff --git a/layouts/robots.txt b/layouts/robots.txt new file mode 100644 index 000000000..9d9b87379 --- /dev/null +++ b/layouts/robots.txt @@ -0,0 +1,4 @@ +User-agent: * + +{{range .Data.Pages}} +Disallow: {{.RelPermalink}}{{end}}