mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'
This commit is contained in:
@@ -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 }}
|
||||
|
Reference in New Issue
Block a user