Skip to content

Commit 35d59e0

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/cache-5
2 parents bc3f980 + 6406b4a commit 35d59e0

File tree

20 files changed

+2958
-5093
lines changed

20 files changed

+2958
-5093
lines changed

.github/workflows/lint-build.yml

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ on:
1010

1111
env:
1212
CACHE_KEY: 'hugo-hinode-template'
13-
CACHE_PATH_DEBIAN: '/tmp/hugo_cache_runner'
14-
CACHE_PATH_WIN: '~\AppData\Local\hugo_cache'
15-
CACHE_PATH_MAC: '/Users/runner/Library/Caches/hugo_cache'
13+
14+
permissions:
15+
pull-requests: read
16+
contents: read
1617

1718
jobs:
1819
lint:
@@ -34,7 +35,7 @@ jobs:
3435
run: npm i
3536

3637
- name: Lint the source files
37-
run: npm run lint
38+
run: npm run lint
3839

3940
build:
4041
needs: lint
@@ -44,17 +45,27 @@ jobs:
4445
os: [macos-latest, windows-latest, ubuntu-latest]
4546
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
4647
node-version: [22.x, 24.x]
48+
include:
49+
- os: ubuntu-latest
50+
hugo_cachedir: '/tmp/hugo_cache_runner'
51+
- os: macos-latest
52+
hugo_cachedir: '/Users/runner/Library/Caches/hugo_cache'
53+
- os: windows-latest
54+
hugo_cachedir: '~\AppData\Local\hugo_cache'
4755

4856
runs-on: ${{ matrix.os }}
4957

58+
env:
59+
HUGO_CACHEDIR: ${{ matrix.hugo_cachedir }}
60+
5061
steps:
5162
- name: Check out repository
5263
uses: actions/checkout@v6
5364

5465
- name: Install Go
5566
uses: actions/setup-go@v6
5667
with:
57-
go-version: ">1.0.0"
68+
go-version: "stable"
5869

5970
- name: Set up Node.js ${{ matrix.node-version }}
6071
uses: actions/setup-node@v6
@@ -64,9 +75,13 @@ jobs:
6475
cache-dependency-path: '**/package-lock.json'
6576

6677
- name: Install Dart Sass
67-
run: |
78+
env:
79+
DART_SASS_VERSION: "1.98.0"
80+
run: |
6881
if [ "$RUNNER_OS" == "Linux" ]; then
69-
sudo snap install dart-sass
82+
curl -fsSL "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz" \
83+
| tar -xz -C "$HOME"
84+
echo "$HOME/dart-sass" >> $GITHUB_PATH
7085
elif [ "$RUNNER_OS" == "macOS" ]; then
7186
brew install sass/sass/sass
7287
elif [ "$RUNNER_OS" == "Windows" ]; then
@@ -76,23 +91,34 @@ jobs:
7691

7792
# [24/AUG/23] Adjusted from npm ci for non-macOS to prevent EBADPLATFORM error due to fsevents
7893
- name: Perform clean install of npm
79-
run: |
94+
run: |
8095
if [ "$RUNNER_OS" == "macOS" ]; then
8196
npm ci
8297
else
8398
npm i
8499
fi
85100
shell: bash
86101

87-
# Cache Hugo cachedir and resourcedir (configured in config/ci/hugo.toml) for each OS
88-
# No additional cache invalidation is needed, Hugo uses checksums itself
102+
# On Windows, HUGO_CACHEDIR is initialised from the matrix as '~\AppData\Local\hugo_cache'.
103+
# Hugo requires an absolute path, so expand ~ to %LOCALAPPDATA% before using the cache.
104+
- name: Expand Hugo cache directory on Windows
105+
if: runner.os == 'Windows'
106+
run: echo "HUGO_CACHEDIR=$env:LOCALAPPDATA\hugo_cache" >> $env:GITHUB_ENV
107+
shell: pwsh
108+
109+
# Cache Hugo cachedir and resourcedir (configured in config/ci/hugo.toml) for each OS.
110+
# Rolling key restores the previous snapshot as a warm start, then saves a fresh one after build.
111+
# No additional content-based invalidation is needed; Hugo uses checksums itself.
89112
- name: Use Hugo cache
90113
uses: actions/cache@v5
91114
with:
92-
path: ${{ runner.os == 'Windows' && env.CACHE_PATH_WIN || runner.os == 'macOS' && env.CACHE_PATH_MAC || env.CACHE_PATH_DEBIAN }}
93-
key: ${{ runner.os }}-${{ env.CACHE_KEY }}
115+
path: ${{ env.HUGO_CACHEDIR }}
116+
key: ${{ runner.os }}-${{ env.CACHE_KEY }}-${{ github.run_id }}
94117
restore-keys: |
95-
${{ runner.os }}-${{ env.CACHE_KEY }}
118+
${{ runner.os }}-${{ env.CACHE_KEY }}-
119+
120+
- name: Display environment
121+
run: npm run env
96122

97123
- name: Build main site
98124
run: npm run build:cache

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/_vendor
22
/public
33
/prebuild
4+
prebuild-headers/
5+
prebuild-headers-dev/
6+
prebuild-headers-prod/
47
resources/
58
node_modules/
69

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

.husky/install.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Skip Husky install in production and CI
2+
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
3+
process.exit(0)
4+
}
5+
const husky = (await import('husky')).default
6+
console.log(husky())

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022-2025 Mark Dumay
3+
Copyright (c) 2022-2026 Mark Dumay
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

config/_default/hugo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
title = "Hinode"
2-
copyright = "Copyright © 2022 - 2025 Mark Dumay."
2+
copyright = "Copyright © 2022 - 2026 Hinode Team."
33
enableGitInfo = true
44

55
# additional settings
@@ -123,7 +123,9 @@ home = ["HTML", "RSS", "REDIR", "netlify", "server"]
123123
source = "static"
124124
target = "static"
125125
[[module.imports]]
126-
path = "github.com/gethinode/hinode"
126+
path = "github.com/gethinode/mod-blocks"
127+
[[module.imports]]
128+
path = "github.com/gethinode/hinode/v2"
127129

128130
[segments]
129131
[segments.headers]

config/_default/params.toml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
[main.colorMode]
1111
enabled = true
1212
modes = ["light", "dark"]
13+
toggle = false
1314
[main.internalLinks]
1415
validate = true
1516
pretty = false
1617
[main.externalLinks]
1718
cue = false
1819
tab = false
1920
[main.build]
20-
transpiler = "libsass"
21-
21+
transpiler = "dartsass"
2222

2323
[debugging]
2424
showJS = false
@@ -30,12 +30,6 @@
3030
release = "https://github.com/gethinode/hinode/releases/tag/"
3131
checkVersion = false
3232

33-
[home]
34-
# sections = ["posts"]
35-
fullCover = false
36-
centerHeadline = false
37-
style = ""
38-
3933
[navigation]
4034
anchor = true
4135
logo = "/img/logo_icon.svg"
@@ -90,24 +84,6 @@
9084
weight = 50
9185
clipboard = true
9286

93-
# toml-docs-start sections
94-
# [sections]
95-
# [sections.posts]
96-
# title = "Posts"
97-
# sort = "date"
98-
# reverse = true
99-
# nested = true
100-
# cols = 3
101-
# color = ""
102-
# padding = "0"
103-
# header = "full"
104-
# footer = "none"
105-
# orientation = "stacked"
106-
# style = "border-0 card-zoom"
107-
# homepage = 3
108-
# separator = true
109-
# toml-docs-end sections
110-
11187
[favicon]
11288
logo = "img/favicon.png"
11389
sizes = [16, 32, 48]
@@ -128,7 +104,7 @@
128104
# themeFontPath = "https://fonts.googleapis.com/css2?family=Inter:wght@200;300;600&display=swap" # external path
129105
themeFontPath = "/fonts" # local path
130106
fontSizeBase = "1rem"
131-
purge = false
107+
purge = true
132108

133109
[schema]
134110
type = "Organization"

config/_default/server.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
Access-Control-Allow-Origin = '*'
88
Content-Security-Policy = """
99
base-uri 'self'; \
10-
connect-src 'self' *.google-analytics.com *.analytics.google.com *.googletagmanager.com; \
10+
connect-src 'self' *.analytics.google.com *.google.com *.google-analytics.com *.googletagmanager.com; \
1111
default-src 'none'; \
12-
font-src 'self' fonts.gstatic.com; \
12+
font-src 'self' fonts.gstatic.com data:; \
1313
form-action 'self'; \
14-
frame-src player.cloudinary.com player.vimeo.com www.youtube-nocookie.com www.youtube.com; \
15-
img-src 'self' *.google-analytics.com *.googletagmanager.com data: *.imgix.net *.imagekit.io *.cloudinary.com i.vimeocdn.com i.ytimg.com tile.openstreetmap.org; \
14+
frame-ancestors 'self' http://localhost:1313 gethinode.com; \
15+
frame-src *.googletagmanager.com player.cloudinary.com www.youtube-nocookie.com www.youtube.com player.vimeo.com; \
16+
img-src 'self' *.google-analytics.com *.googletagmanager.com googletagmanager.com ssl.gstatic.com www.gstatic.com data: *.imgix.net *.imagekit.io *.cloudinary.com i.ytimg.com tile.openstreetmap.org i.vimeocdn.com; \
1617
manifest-src 'self'; \
1718
media-src 'self'; \
1819
object-src 'none'; \
19-
script-src 'self' *.google-analytics.com *.googletagmanager.com; \
20-
style-src 'self' www.youtube.com; \
20+
script-src 'self' *.google-analytics.com *.googletagmanager.com *.analytics.google.com googletagmanager.com tagmanager.google.com player.vimeo.com; \
21+
style-src 'self' googletagmanager.com tagmanager.google.com fonts.googleapis.com www.youtube.com 'unsafe-inline'; \
2122
"""
2223
Permissions-Policy = 'geolocation=(), midi=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), fullscreen=(), payment=() '
2324
Referrer-Policy = 'strict-origin'
2425
Strict-Transport-Security = 'max-age=31536000; includeSubDomains; preload'
2526
X-Content-Type-Options = 'nosniff'
26-
X-Frame-Options = 'SAMEORIGIN'
2727
X-XSS-Protection = '1; mode=block'
2828
cache-control = 'max-age=0, no-cache, no-store, must-revalidate '
2929

config/ci/hugo.toml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
# cachedir default on POSIX: '/tmp/hugo_cache_runner'
22
# cachedir default on Windows: '~\AppData\Local\hugo_cache'
33
# cachedir default on macOS: '/Users/runner/Library/Caches/hugo_cache'
4+
#
5+
# All six Hugo cache types are configured here to:
6+
# - redirect assets/images from :resourceDir to :cacheDir so GitHub Actions can cache them
7+
# - set maxAge = -1 across the board so --gc never prunes entries between CI runs
48

59
[caches]
610
[caches.assets]
7-
dir = ':cacheDir/resources/_gen' # map to cacheDir instead of resourceDir to utilize GitHub action/cache
8-
maxAge = -1
9-
[caches.getcsv]
10-
dir = ':cacheDir/:project'
11-
maxAge = -1
12-
[caches.getjson]
13-
dir = ':cacheDir/:project'
11+
dir = ':cacheDir/resources/_gen' # redirect from :resourceDir to :cacheDir
1412
maxAge = -1
1513
[caches.getresource]
1614
dir = ':cacheDir/:project'
1715
maxAge = -1
1816
[caches.images]
19-
dir = ':cacheDir/resources/_gen' # map to cacheDir instead of resourceDir to utilize GitHub action/cache
17+
dir = ':cacheDir/resources/_gen' # redirect from :resourceDir to :cacheDir
2018
maxAge = -1
19+
[caches.misc]
20+
dir = ':cacheDir/:project'
21+
maxAge = -1
22+
[caches.modulequeries]
23+
dir = ':cacheDir/modules'
24+
maxAge = -1 # override default 24h so --gc does not prune module query results
2125
[caches.modules]
2226
dir = ':cacheDir/modules'
2327
maxAge = -1

0 commit comments

Comments
 (0)