Skip to content

Commit

Permalink
Ajout d'une notion de canonicalDomain.
Browse files Browse the repository at this point in the history
  • Loading branch information
nfriedli committed Dec 27, 2024
1 parent 54c04dd commit bdf6d80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ keepWhitespace = true

[params]
images = ["/images/opengraph.jpg"]
canonicalDomain = "https://nicolasfriedli.ch"

[params.author]
name = "Nicolas Friedli"
Expand Down
4 changes: 2 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
{{ partialCached "head/favicon" . }}

<link rel="alternate" type="application/rss+xml" href="{{ relURL "index.xml" }}" title="{{ site.Title }}">
<link rel="canonical" href="{{ .Permalink }}">
{{ if not (hasPrefix .Permalink "https://nicolasfriedli.ch/") }}
<link rel="canonical" href="{{ site.Params.canonicalDomain}}{{ .RelPermalink }}">
{{ if not (hasPrefix .Permalink site.Params.canonicalDomain) }}
<meta name="robots" content="noindex">
{{ end }}

Expand Down

0 comments on commit bdf6d80

Please sign in to comment.