mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-11 01:38:28 +00:00
Add support for canonical links
This commit is contained in:
parent
01aeeee3d6
commit
f1fc8b6d84
2 changed files with 12 additions and 0 deletions
11
README.md
11
README.md
|
@ -310,6 +310,17 @@ relative to the `static` folder of your Hugo site:
|
||||||
|
|
||||||
All custom JS files will be added before closing body tag of a `baseof.html` file.
|
All custom JS files will be added before closing body tag of a `baseof.html` file.
|
||||||
|
|
||||||
|
#### Enable User Canonical
|
||||||
|
|
||||||
|
You can specify an explicit canonical link which helps to set a single source
|
||||||
|
of truth for your page. See [here](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls#rel-canonical-link-method)
|
||||||
|
how this helps Google to crawl your page.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[Params]
|
||||||
|
enableUserCanonical = true
|
||||||
|
```
|
||||||
|
|
||||||
#### Entry Meta
|
#### Entry Meta
|
||||||
|
|
||||||
Entry metadata are relevant information about your entry such as published date, last modified date, category, etc. You
|
Entry metadata are relevant information about your entry such as published date, last modified date, category, etc. You
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
{{- $cssMain := resources.Get "css/main.css" }}
|
{{- $cssMain := resources.Get "css/main.css" }}
|
||||||
{{- $cssPrint := resources.Get "css/print.css" }}
|
{{- $cssPrint := resources.Get "css/print.css" }}
|
||||||
{{- $style := slice $cssReboot $cssMain $cssPrint | resources.Concat "css/bundle.css" }}
|
{{- $style := slice $cssReboot $cssMain $cssPrint | resources.Concat "css/bundle.css" }}
|
||||||
|
{{if site.Params.enableUserCanonical}}<link rel="canonical" href="{{ .RelPermalink }}"/>{{end}}
|
||||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||||
{{- range .Site.Params.customCSS }}
|
{{- range .Site.Params.customCSS }}
|
||||||
<link rel="stylesheet" href="{{ . | relURL }}">
|
<link rel="stylesheet" href="{{ . | relURL }}">
|
||||||
|
|
Loading…
Reference in a new issue