mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-25 15:58:53 +00:00
Add noindex to alias explanation
Closes rdwatters/hugo-docs-concept#131 See PR gohugoio/hugo#3521
This commit is contained in:
@@ -120,7 +120,7 @@ There are a few predefined variables that Hugo is aware of. See [Page Variables]
|
||||
: **experimental**; specify `"rst"` for reStructuredText (requires`rst2html`) or `"md"` (default) for Markdown.
|
||||
|
||||
`outputs`
|
||||
: allows you to specify output formats specific to the content. See [output formats][outputs]
|
||||
: allows you to specify output formats specific to the content. See [output formats][outputs].
|
||||
|
||||
`publishdate`
|
||||
: if in the future, content will not be rendered unless the `--buildFuture` flag is passed to `hugo`.
|
||||
@@ -135,7 +135,7 @@ There are a few predefined variables that Hugo is aware of. See [Page Variables]
|
||||
: the title for the content.
|
||||
|
||||
`type`
|
||||
: the type of the content; this value will be derived from the directory (i.e., the [section][]) automatically if unset.
|
||||
: the type of the content; this value will be automatically derived from the directory (i.e., the [section][]) if not specified in front matter.
|
||||
|
||||
`url`
|
||||
: the full path to the content from the web root. It makes no assumptions about the path of the content file. It also ignores any language prefixes of
|
||||
@@ -145,7 +145,7 @@ the multilingual feature.
|
||||
: used for [ordering your content in lists][ordering].
|
||||
|
||||
{{% note "Hugo's Default URL Destinations" %}}
|
||||
If neither `slug` nor `url` is present and [permalinks are not configured otherwise](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
|
||||
If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site `config` file](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
|
||||
{{% /note %}}
|
||||
|
||||
### User-Defined
|
||||
|
||||
@@ -157,13 +157,14 @@ Assuming a `baseURL` of `yoursite.com`, the contents of the auto-generated alias
|
||||
<head>
|
||||
<title>http://yoursite.com/posts/my-intended-url</title>
|
||||
<link rel="canonical" href="http://yoursite.com/posts/my-intended-url"/>
|
||||
<meta name=\"robots\" content=\"noindex\">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="refresh" content="0; url=http://yoursite.com/posts/my-intended-url"/>
|
||||
</head>
|
||||
</html>
|
||||
```
|
||||
|
||||
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case. If an end user of your website goes to `https://yoursite.com/posts/my-old-url`, they will now be automatically redirected to the newer, correct URL.
|
||||
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case. If an end user of your website goes to `https://yoursite.com/posts/my-old-url`, they will now be automatically redirected to the newer, correct URL. The addition of `<meta name=\"robots\" content=\"noindex\">` lets search engine bots know they they should not crawl and index your new alias page.
|
||||
|
||||
### Customizing
|
||||
|
||||
@@ -282,4 +283,4 @@ For example, if your `/post/first/` page contains a link to `/about/`, Hugo will
|
||||
[front matter]: /content-management/front-matter/
|
||||
[multilingual]: /content-management/multilingual/
|
||||
[sections]: /content-management/sections/
|
||||
[usage]: /getting-started/usage/
|
||||
[usage]: /getting-started/usage/
|
||||
|
||||
@@ -129,7 +129,7 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
|
||||
<ul>
|
||||
{{ $data := .Data }}
|
||||
{{ range $key, $value := .Data.Taxonomy.Alphabetical }}
|
||||
<li><a href="{{ .Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
|
||||
<li><a href="{{ $.Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
```
|
||||
@@ -140,7 +140,7 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
|
||||
<ul>
|
||||
{{ $data := .Data }}
|
||||
{{ range $key, $value := .Data.Taxonomy.ByCount }}
|
||||
<li><a href="{{ .Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
|
||||
<li><a href="{{ $.Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
```
|
||||
@@ -338,4 +338,4 @@ Because taxonomies are lists, the [`.GetPage` function][getpage] can be used to
|
||||
[lists]: /templates/lists/
|
||||
[renderlists]: /templates/lists/
|
||||
[single page template]: /templates/single-page-templates/
|
||||
[sitevars]: /variables/site/
|
||||
[sitevars]: /variables/site/
|
||||
|
||||
Reference in New Issue
Block a user