Skip to content

Commit 39b89f0

Browse files
committed
switch to pretty URLs and add canonical link tags
Remove uglyURLs so that paths no longer carry the unnecessary .html extension, which only adds length and makes URLs harder to read and type. Add baseURL and canonical link tags so that search engines can identify the page and URL as authoritative. Use relURL for the banner image so it resolves correctly under pretty URL paths.
1 parent 643f10f commit 39b89f0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

hugo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2+
baseURL: https://gitgitgadget.github.io/
23
languageCode: en
34
title: GitGitGadget
45
relativeURLs: true
5-
uglyURLs: true
66
disableKinds:
77
- taxonomy
88
markup:

layouts/_default/baseof.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>{{ .Title }}</title>
7+
<link rel="canonical" href="{{ .Permalink }}">
78
<link rel="icon" href="{{ relURL "favicon.ico" }}">
89
{{- $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "main.scss" . | css.Sass }}
910
<link rel="stylesheet" href="{{ $style.RelPermalink }}">

layouts/partials/banner.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- define "partials/logo.html" -}}
2-
<img src="images/gitgitgadget-explanation.png" alt="An arrow from git logo to an envelop with git logo. The arrow is labelled by famous Inspector Gadget hat."/>
2+
<img src="{{ relURL "images/gitgitgadget-explanation.png" }}" alt="An arrow from git logo to an envelop with git logo. The arrow is labelled by famous Inspector Gadget hat."/>
33
{{- end -}}
44
{{- define "partials/subtitle.html" -}}
55
<big>GitGitGadget</big><br />

0 commit comments

Comments
 (0)