Update hugo.toml: Add enableRobotsTXT and environment parameter
All checks were successful
Build and Deploy Hugo Site / build_and_deploy (push) Successful in 1m37s
All checks were successful
Build and Deploy Hugo Site / build_and_deploy (push) Successful in 1m37s
Logic for robots.txt while being in development environment to disallow all
This commit is contained in:
parent
a0a49eb357
commit
60437660e8
2 changed files with 10 additions and 3 deletions
|
|
@ -1,6 +1,3 @@
|
||||||
########################### Deployment #############################
|
|
||||||
# set to "development" or "production" to deploy the site to the correct environment
|
|
||||||
environment = "development"
|
|
||||||
|
|
||||||
######################## default configuration ####################
|
######################## default configuration ####################
|
||||||
# The base URL of your site (required). This will be prepended to all relative URLs.
|
# The base URL of your site (required). This will be prepended to all relative URLs.
|
||||||
|
|
@ -19,6 +16,12 @@ defaultContentLanguage = "de"
|
||||||
# disable language
|
# disable language
|
||||||
disableLanguages = ["en"]
|
disableLanguages = ["en"]
|
||||||
hasCJKLanguage = false # If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage
|
hasCJKLanguage = false # If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage
|
||||||
|
enableRobotsTXT = true
|
||||||
|
|
||||||
|
########################### Deployment #############################
|
||||||
|
# set to "development" or "production" to deploy the site to the correct environment and set robots.txt to disallow all
|
||||||
|
[params]
|
||||||
|
environment = "development"
|
||||||
|
|
||||||
########################### Services #############################
|
########################### Services #############################
|
||||||
[services]
|
[services]
|
||||||
|
|
|
||||||
4
themes/hugoplate/layouts/robots.txt
Normal file
4
themes/hugoplate/layouts/robots.txt
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
User-agent: *
|
||||||
|
{{ if eq .Site.Params.environment "development" }}
|
||||||
|
Disallow: /
|
||||||
|
{{ end }}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue