This commit is contained in:
Noam Lerner 2024-11-20 16:47:41 +00:00 committed by GitHub
commit cd907c12a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions
README.md
layouts/_default

View file

@ -315,6 +315,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.
#### 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 metadata are relevant information about your entry such as published date, last modified date, category, etc. You

View file

@ -20,6 +20,7 @@
{{- $cssMain := resources.Get "css/main.css" }}
{{- $cssPrint := resources.Get "css/print.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 }}">
{{- range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ . | relURL }}">