mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Merge commit '35dec7c96f7ee3eb17dd444f7067f0c776fb56ae'
This commit is contained in:
@@ -14,7 +14,7 @@ aliases: [/extras/robots-txt/]
|
||||
|
||||
To generate a robots.txt file from a template, change the [site configuration]:
|
||||
|
||||
{{< code-toggle file="hugo" >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
enableRobotsTXT = true
|
||||
{{< /code-toggle >}}
|
||||
|
||||
@@ -35,7 +35,7 @@ You may overwrite the internal template with a custom template. Hugo selects the
|
||||
|
||||
## robots.txt template example
|
||||
|
||||
{{< code file="layouts/robots.txt" >}}
|
||||
{{< code file=layouts/robots.txt >}}
|
||||
User-agent: *
|
||||
{{ range .Pages }}
|
||||
Disallow: {{ .RelPermalink }}
|
||||
@@ -47,7 +47,7 @@ This template creates a robots.txt file with a `Disallow` directive for each pag
|
||||
{{% note %}}
|
||||
To create a robots.txt file without using a template:
|
||||
|
||||
1. Set `enableRobotsTXT` to `false` in the [site configuration].
|
||||
1. Set `enableRobotsTXT` to `false` in the site configuration.
|
||||
2. Create a robots.txt file in the `static` directory.
|
||||
|
||||
Remember that Hugo copies everything in the [static directory][static] to the root of `publishDir` (typically `public`) when you build your site.
|
||||
|
Reference in New Issue
Block a user