Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'

This commit is contained in:
Bjørn Erik Pedersen
2023-05-22 16:47:07 +02:00
341 changed files with 3107 additions and 4238 deletions

View File

@@ -2,20 +2,14 @@
title: Robots.txt File
linktitle: Robots.txt
description: Hugo can generate a customized robots.txt in the same way as any other template.
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [templates]
keywords: [robots,search engines]
menu:
docs:
parent: "templates"
parent: templates
weight: 165
weight: 165
sections_weight: 165
draft: false
aliases: [/extras/robots-txt/]
toc: false
---
To generate a robots.txt file from a template, change the [site configuration][config]:
@@ -41,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" download="robots.txt" >}}
{{< code file="layouts/robots.txt" >}}
User-agent: *
{{ range .Pages }}
Disallow: {{ .RelPermalink }}