diff --git a/exampleSite/content/params/canonical-url.fr.md b/exampleSite/content/params/canonical-url.fr.md new file mode 100644 index 0000000000000000000000000000000000000000..7cd5bdd68d4118fd005aa24e7712de988e40dfc9 --- /dev/null +++ b/exampleSite/content/params/canonical-url.fr.md @@ -0,0 +1,11 @@ +--- +title: Canonical URL - Testing LangAbsURL +hide_sidebar: true +canonical_url: ./params +--- + +This page tests whether or not `absLangURL` gets applied correctly to `canonical_url` param. + +The `canonical_url` is set to `./params`. + +The `href` value of the `` element should be `"///fr/params"`. \ No newline at end of file diff --git a/exampleSite/content/params/canonical-url.md b/exampleSite/content/params/canonical-url.md new file mode 100644 index 0000000000000000000000000000000000000000..f3cb8c2a567bce33ff18de57e584daa47d8adc8e --- /dev/null +++ b/exampleSite/content/params/canonical-url.md @@ -0,0 +1,15 @@ +--- +title: Canonical URL +hide_sidebar: true +canonical_url: https://google.com +--- + +The `canonical_url` config parameter sets the canonical url of the page. The value must be an *absolute url*. + +If `canonical_url` is not specified, the canonical URL will be the pages' default url. + +```md +title: Canonical URL +hide_sidebar: true +canonical_url: https://google.com +``` \ No newline at end of file diff --git a/exampleSite/content/params/metatag-robots.md b/exampleSite/content/params/metatag-robots.md new file mode 100644 index 0000000000000000000000000000000000000000..aa11597726f11b9934ce4ee8579f2f728cb22690 --- /dev/null +++ b/exampleSite/content/params/metatag-robots.md @@ -0,0 +1,17 @@ +--- +title: Metatag Robots Config Parameter +hide_sidebar: true +metatag_robots: noindex, nofollow +--- + +The `metatag_robots` config parameter grants the ability to add a "robots" metatag with the set `content` attribute. + +If blank, no meta tag will be created for "robots". + +Usage: +```md +title: Metatag Robots Config Parameter +hide_sidebar: true +metatag_robots: noindex, nofollow +``` + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 3c7d309f33cd903cbfc9e92978e229f8c2130601..90c177d845df3c7daa036957a0eb18cba95588df 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -35,6 +35,9 @@ {{- with .Params.page_favicon | default .Site.Params.favicon | default "https://www.eclipse.org/favicon.ico"}} {{- end -}} +{{- with .Page.Params.metatag_robots }} + +{{- end }} {{- with .Params.share_img | default .Params.image | default .Site.Params.share_img | default .Site.Params.logo }} @@ -57,7 +60,8 @@ {{ hugo.Generator -}} - +{{ $canonical_url := (.Page.Params.canonical_url | default .Permalink) | absLangURL }} + {{ with .OutputFormats.Get "RSS" }} {{ end }}