mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 16:17:21 +00:00
Add noindex to alias explanation
Closes rdwatters/hugo-docs-concept#131 See PR gohugoio/hugo#3521
This commit is contained in:
1 parent
208d164640
commit
8744e6d0c5
3 files changed
+7
-6
No files matched your search
@@ -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.
|
: **experimental**; specify `"rst"` for reStructuredText (requires`rst2html`) or `"md"` (default) for Markdown.
|
||||||
|
|
||||||
`outputs`
|
`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`
|
`publishdate`
|
||||||
: if in the future, content will not be rendered unless the `--buildFuture` flag is passed to `hugo`.
|
: 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.
|
: the title for the content.
|
||||||
|
|
||||||
`type`
|
`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`
|
`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
|
: 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].
|
: used for [ordering your content in lists][ordering].
|
||||||
|
|
||||||
{{% note "Hugo's Default URL Destinations" %}}
|
{{% 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 %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### User-Defined
|
### User-Defined
|
||||||
|
|||||||
@@ -157,13 +157,14 @@ Assuming a `baseURL` of `yoursite.com`, the contents of the auto-generated alias
|
|||||||
<head>
|
<head>
|
||||||
<title>http://yoursite.com/posts/my-intended-url</title>
|
<title>http://yoursite.com/posts/my-intended-url</title>
|
||||||
<link rel="canonical" href="http://yoursite.com/posts/my-intended-url"/>
|
<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="content-type" content="text/html; charset=utf-8"/>
|
||||||
<meta http-equiv="refresh" content="0; url=http://yoursite.com/posts/my-intended-url"/>
|
<meta http-equiv="refresh" content="0; url=http://yoursite.com/posts/my-intended-url"/>
|
||||||
</head>
|
</head>
|
||||||
</html>
|
</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
|
### Customizing
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
|
|||||||
<ul>
|
<ul>
|
||||||
{{ $data := .Data }}
|
{{ $data := .Data }}
|
||||||
{{ range $key, $value := .Data.Taxonomy.Alphabetical }}
|
{{ 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 }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
```
|
```
|
||||||
@@ -140,7 +140,7 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
|
|||||||
<ul>
|
<ul>
|
||||||
{{ $data := .Data }}
|
{{ $data := .Data }}
|
||||||
{{ range $key, $value := .Data.Taxonomy.ByCount }}
|
{{ 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 }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in new issue
Block a user