Skip to content

Commit 2b40128

Browse files
committed
Improve config and layout
Exclude the resources folder, update the versions of hugo we're building with, add an Archive and a Search page, and clean up the config TOML file, while also enabling some more features (Search and Archive pages, ToCs, reading time and post length, and I think that's it).
1 parent 384e283 commit 2b40128

5 files changed

Lines changed: 83 additions & 125 deletions

File tree

.github/workflows/hugo.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ jobs:
3030
build:
3131
runs-on: ubuntu-latest
3232
env:
33+
# Get the latest versions from https://gohugo.io/host-and-deploy/host-on-gitlab-pages/
3334
DART_SASS_VERSION: 1.90.0
34-
GO_VERSION: 1.24.5
35-
HUGO_VERSION: 0.148.2
35+
GO_VERSION: 1.24.9
36+
HUGO_VERSION: 0.152.2
3637
NODE_VERSION: 22.18.0
3738
TZ: Europe/Zurich
3839
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.hugo_build.lock
22
.vscode
33
public
4+
resources

content/archives.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Archive"
3+
layout: "archives"
4+
url: "/archives/"
5+
summary: archives
6+
---

content/search.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Search"
3+
layout: "search"
4+
summary: "search"
5+
placeholder: "Start typing..."
6+
searchHidden: true
7+
---

hugo.toml

Lines changed: 66 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -3,146 +3,89 @@ languageCode = 'en-gb'
33
title = 'How to fail at brevity'
44
theme = ['PaperMod', 'hugo-admonitions']
55

6-
enableRobotsTXT = true
76
buildDrafts = false
87
buildFuture = false
98
buildExpired = false
9+
enableRobotsTXT = true
1010

1111
[caches]
1212
[caches.images]
1313
dir = ':cacheDir/images'
1414

1515
[minify]
16-
disableXML = true
17-
minifyOutput = true
16+
disableXML = true
17+
minifyOutput = false
1818

1919
[params]
20-
# env: production # to enable google analytics, opengraph, twitter-cards and schema.
21-
# title: ExampleSite
22-
# description: "ExampleSite description"
23-
# keywords: [Blog, Portfolio, PaperMod]
24-
# author: Me
25-
# # author: ["Me", "You"] # multiple authors
26-
# images: ["<link or path of image for opengraph, twitter-cards>"]
27-
# DateFormat: "January 2, 2006"
28-
# defaultTheme: auto # dark, light
29-
# disableThemeToggle: false
30-
31-
# ShowReadingTime: true
32-
# ShowShareButtons: true
33-
# ShowPostNavLinks: true
34-
# ShowBreadCrumbs: true
35-
ShowCodeCopyButtons = true
36-
# ShowWordCount: true
37-
# ShowRssButtonInSectionTermList: true
38-
# UseHugoToc: true
39-
# disableSpecial1stPost: false
40-
# disableScrollToTop: false
41-
# comments: false
42-
# hidemeta: false
43-
# hideSummary: false
44-
# showtoc: false
45-
# tocopen: false
20+
# https://github.com/adityatelange/hugo-PaperMod/wiki/Variables
21+
comments = false
22+
disableSpecial1stPost = false
23+
env = "production" # to enable google analytics, opengraph, twitter-cards and schema.
24+
ShowBreadCrumbs = false
25+
ShowCodeCopyButtons = true
26+
ShowPostNavLinks = false
27+
ShowReadingTime = true
28+
ShowRssButtonInSectionTermList = true
29+
ShowWordCount = true
30+
showtoc = true
31+
tocopen = true
32+
UseHugoToc = true
33+
# Currently unused
34+
# description = "ExampleSite description"
35+
# keywords = [ "Blog", "Portfolio", "PaperMod" ]
36+
# author = "Me"
37+
# images = [ "<link or path of image for opengraph, twitter-cards>" ]
38+
# DateFormat = "January 2, 2006"
4639

4740
[params.assets]
48-
# to disable highlight.js
49-
disableHLJS = true
5041
# disableFingerprinting: true
51-
favicon = '/favicon.ico'
52-
favicon16x16 = '/favicon-16x16.png'
53-
favicon32x32 = '/favicon-32x32.png'
54-
apple_touch_icon = '/apple-touch-icon.png'
55-
safari_pinned_tab = '/safari-pinned-tab.png'
56-
57-
# label:
58-
# text: "Home"
59-
# icon: /apple-touch-icon.png
60-
# iconHeight: 35
61-
62-
# # profile-mode
63-
# profileMode:
64-
# enabled: false # needs to be explicitly set
65-
# title: ExampleSite
66-
# subtitle: "This is subtitle"
67-
# imageUrl: "<img location>"
68-
# imageWidth: 120
69-
# imageHeight: 120
70-
# imageTitle: my image
71-
# buttons:
72-
# - name: Posts
73-
# url: posts
74-
# - name: Tags
75-
# url: tags
76-
77-
# # home-info mode
78-
# homeInfoParams:
79-
# Title: "Hi there \U0001F44B"
80-
# Content: Welcome to my blog
81-
82-
# socialIcons:
83-
# - name: x
84-
# url: "https://x.com/"
85-
# - name: stackoverflow
86-
# url: "https://stackoverflow.com"
87-
# - name: github
88-
# url: "https://github.com/"
89-
90-
# analytics:
91-
# google:
92-
# SiteVerificationTag: "XYZabc"
93-
# bing:
94-
# SiteVerificationTag: "XYZabc"
95-
# yandex:
96-
# SiteVerificationTag: "XYZabc"
97-
98-
# cover:
99-
# hidden: true # hide everywhere but not in structured data
100-
# hiddenInList: true # hide on list pages and home
101-
# hiddenInSingle: true # hide on single page
102-
103-
# editPost:
104-
# URL: "https://github.com/<path_to_repo>/content"
105-
# Text: "Suggest Changes" # edit text
106-
# appendFilePath: true # to append file path to Edit link
107-
108-
# # for search
109-
# # https://fusejs.io/api/options.html
110-
# fuseOpts:
111-
# isCaseSensitive: false
112-
# shouldSort: true
113-
# location: 0
114-
# distance: 1000
115-
# threshold: 0.4
116-
# minMatchCharLength: 0
117-
# limit: 10 # refer: https://www.fusejs.io/api/methods.html#search
118-
# keys: ["title", "permalink", "summary", "content"]
119-
# menu:
120-
# main:
121-
# - identifier: categories
122-
# name: categories
123-
# url: /categories/
124-
# weight: 10
125-
# - identifier: tags
126-
# name: tags
127-
# url: /tags/
128-
# weight: 20
129-
# - identifier: example
130-
# name: example.org
131-
# url: https://example.org
132-
# weight: 30
42+
disableHLJS = true
43+
44+
apple_touch_icon = '/apple-touch-icon.png'
45+
favicon = '/favicon.ico'
46+
favicon16x16 = '/favicon-16x16.png'
47+
favicon32x32 = '/favicon-32x32.png'
48+
safari_pinned_tab = '/safari-pinned-tab.png'
49+
50+
# [analytics.google]
51+
# SiteVerificationTag = "XYZabc"
52+
53+
# Menu items
54+
[[menu.main]]
55+
identifier = "archives"
56+
name = "Archive"
57+
url = "/archives/"
58+
weight = 10
59+
60+
[[menu.main]]
61+
identifier = "search"
62+
name = "Search"
63+
url = "/search/"
64+
weight = 20
13365

13466
[markup]
135-
[markup.highlight]
136-
codeFences = true
137-
guessSyntax = true
138-
lineNos = false
139-
style = "monokai"
140-
pygmentsUseClasses = true
141-
#noClasses = false
142-
#anchorLineNos = true
143-
# Read: https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#using-hugos-syntax-highlighter-chroma
67+
[markup.highlight]
68+
codeFences = true
69+
guessSyntax = true
70+
lineNos = false
71+
style = "monokai"
72+
# noClasses = false
73+
# Read: https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#using-hugos-syntax-highlighter-chroma
14474

14575
[sitemap]
14676
disable = false
14777
filename = 'sitemap.xml'
148-
priority = -1
78+
priority = -1
79+
80+
# For Search
81+
[outputs]
82+
home =[ "html", "rss", "json" ]
83+
[fuseOpts]
84+
distance = 1000
85+
isCaseSensitive = false
86+
keys = ["title", "permalink", "summary", "content"]
87+
limit = 10 # refer: https://www.fusejs.io/api/methods.html#search
88+
location = 0
89+
minMatchCharLength = 0
90+
shouldSort = true
91+
threshold = 0.4

0 commit comments

Comments
 (0)