Skip to content

Commit 4f7b071

Browse files
author
Splitter
committed
chore(templates): update modules to latest commits
1 parent 4fa812a commit 4f7b071

File tree

8 files changed

+159
-98
lines changed

8 files changed

+159
-98
lines changed

โ€Ž.devcontainer/devcontainer.jsonโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"customizations": {
77
"vscode": {
88
"extensions": [
9-
"lore.lore-studio"
9+
"hugoblox.hugoblox-studio"
1010
]
1111
}
1212
},
@@ -22,4 +22,4 @@
2222
"label": "Hugo Server"
2323
}
2424
}
25-
}
25+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Build
2+
3+
env:
4+
NODE_VERSION: '20'
5+
6+
on:
7+
# Standalone trigger for PR validation
8+
pull_request:
9+
branches: ['main']
10+
# Reusable workflow trigger - called by deploy.yml
11+
workflow_call:
12+
outputs:
13+
artifact-id:
14+
description: 'The ID of the uploaded artifact'
15+
value: ${{ jobs.build.outputs.artifact-id }}
16+
# Allow manual trigger for testing
17+
workflow_dispatch:
18+
19+
# Read-only permissions for security
20+
permissions:
21+
contents: read
22+
23+
# Prevent duplicate builds for the same PR
24+
concurrency:
25+
group: build-${{ github.head_ref || github.run_id }}
26+
cancel-in-progress: true
27+
28+
jobs:
29+
build:
30+
if: github.repository_owner != 'HugoBlox'
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 10
33+
outputs:
34+
artifact-id: ${{ steps.upload.outputs.artifact-id }}
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
with:
39+
# Fetch history for Hugo's .GitInfo and .Lastmod
40+
fetch-depth: 0
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v6
44+
with:
45+
node-version: ${{ env.NODE_VERSION }}
46+
47+
- name: Setup pnpm
48+
if: hashFiles('package.json') != ''
49+
uses: pnpm/action-setup@v4
50+
51+
- name: Get Hugo Version
52+
id: hugo-version
53+
run: |
54+
VERSION=$(grep "hugo_version" hugoblox.yaml | awk '{print $2}' | tr -d "'\""")
55+
echo "HUGO_VERSION=$VERSION" >> $GITHUB_ENV
56+
57+
- name: Install dependencies
58+
run: |
59+
# Install Tailwind CLI if package.json exists
60+
if [ -f "package.json" ]; then
61+
echo "Installing Tailwind dependencies..."
62+
pnpm install --no-frozen-lockfile || npm install
63+
fi
64+
65+
- name: Setup Hugo
66+
uses: peaceiris/actions-hugo@v3
67+
with:
68+
hugo-version: ${{ env.HUGO_VERSION }}
69+
extended: true
70+
71+
# Cache dependencies (Go modules, node_modules) - stable, rarely changes
72+
- uses: actions/cache@v4
73+
with:
74+
path: |
75+
/tmp/hugo_cache_runner/
76+
node_modules/
77+
modules/*/node_modules/
78+
key: ${{ runner.os }}-hugo-deps-${{ hashFiles('**/go.mod', '**/package-lock.json',
79+
'**/pnpm-lock.yaml') }}
80+
restore-keys: |
81+
${{ runner.os }}-hugo-deps-
82+
83+
# Cache Hugo resources (processed images, CSS) - invalidates only when assets/config change
84+
- uses: actions/cache@v4
85+
with:
86+
path: resources/
87+
key: ${{ runner.os }}-hugo-resources-${{ hashFiles('assets/**/*', 'config/**/*',
88+
'hugo.yaml', 'package.json') }}
89+
restore-keys: |
90+
${{ runner.os }}-hugo-resources-
91+
92+
- name: Build with Hugo
93+
env:
94+
HUGO_ENVIRONMENT: production
95+
HUGO_BLOX_LICENSE: ${{ secrets.HUGO_BLOX_LICENSE }}
96+
run: |
97+
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
98+
hugo --minify
99+
100+
- name: Generate Pagefind search index (if applicable)
101+
run: |
102+
# Check if site uses Pagefind search
103+
if [ -f "package.json" ] && grep -q "pagefind" package.json; then
104+
pnpm run pagefind || npx pagefind --site "public"
105+
fi
106+
107+
- name: Upload artifact
108+
id: upload
109+
uses: actions/upload-pages-artifact@v4
110+
with:
111+
path: ./public

โ€Ž.github/workflows/deploy.ymlโ€Ž

Lines changed: 22 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Deploy website to GitHub Pages
22

3-
env:
4-
NODE_VERSION: '20'
5-
63
on:
74
# Trigger the workflow every time you push to the `main` branch
85
push:
@@ -21,95 +18,39 @@ concurrency:
2118
cancel-in-progress: false
2219

2320
jobs:
24-
# Build website
25-
build:
21+
# Check deployment configuration
22+
config:
2623
if: github.repository_owner != 'HugoBlox'
2724
runs-on: ubuntu-latest
25+
outputs:
26+
deploy-host: ${{ steps.check.outputs.host }}
2827
steps:
2928
- name: Checkout
3029
uses: actions/checkout@v4
3130
with:
32-
# Fetch history for Hugo's .GitInfo and .Lastmod
33-
fetch-depth: 0
34-
35-
- name: Setup Node.js
36-
uses: actions/setup-node@v4
37-
with:
38-
node-version: ${{ env.NODE_VERSION }}
39-
40-
- name: Setup pnpm
41-
if: hashFiles('package.json') != ''
42-
uses: pnpm/action-setup@v4
43-
44-
- name: Get Hugo Version
45-
id: hugo-version
46-
run: |
47-
VERSION=$(grep "hugo_version" hugoblox.yaml | awk '{print $2}' | tr -d "'\"")
48-
echo "HUGO_VERSION=$VERSION" >> $GITHUB_ENV
49-
50-
- name: Install dependencies
51-
run: |
52-
# Install Tailwind CLI if package.json exists
53-
if [ -f "package.json" ]; then
54-
echo "Installing Tailwind dependencies..."
55-
pnpm install --no-frozen-lockfile || npm install
56-
fi
57-
58-
- name: Setup Hugo
59-
uses: peaceiris/actions-hugo@v3
60-
with:
61-
hugo-version: ${{ env.HUGO_VERSION }}
62-
extended: true
31+
sparse-checkout: hugoblox.yaml
32+
sparse-checkout-cone-mode: false
6333

64-
# Cache dependencies (Go modules, node_modules) - stable, rarely changes
65-
- uses: actions/cache@v4
66-
with:
67-
path: |
68-
/tmp/hugo_cache_runner/
69-
node_modules/
70-
modules/*/node_modules/
71-
key: ${{ runner.os }}-hugo-deps-${{ hashFiles('**/go.mod', '**/package-lock.json',
72-
'**/pnpm-lock.yaml') }}
73-
restore-keys: |
74-
${{ runner.os }}-hugo-deps-
75-
76-
# Cache Hugo resources (processed images, CSS) - invalidates only when assets/config change
77-
- uses: actions/cache@v4
78-
with:
79-
path: resources/
80-
key: ${{ runner.os }}-hugo-resources-${{ hashFiles('assets/**/*', 'config/**/*',
81-
'hugo.yaml', 'package.json') }}
82-
restore-keys: |
83-
${{ runner.os }}-hugo-resources-
84-
85-
- name: Setup Pages
86-
id: pages
87-
uses: actions/configure-pages@v5
88-
89-
- name: Build with Hugo
90-
env:
91-
HUGO_ENVIRONMENT: production
92-
HUGO_BLOX_LICENSE: ${{ secrets.HUGO_BLOX_LICENSE }}
34+
- name: Check deploy host
35+
id: check
9336
run: |
94-
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
95-
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
37+
# Read deploy.host from hugoblox.yaml, default to github-pages
38+
HOST=$(grep -A5 "^deploy:" hugoblox.yaml 2>/dev/null | grep "host:" | awk '{print $2}' | tr -d "'\""" || echo "github-pages")
39+
HOST=${HOST:-github-pages}
40+
echo "host=$HOST" >> $GITHUB_OUTPUT
41+
echo "Deployment target: $HOST"
9642
97-
- name: Generate Pagefind search index (if applicable)
98-
run: |
99-
# Check if site uses Pagefind search
100-
if [ -f "package.json" ] && grep -q "pagefind" package.json; then
101-
pnpm run pagefind || npx pagefind --site "public"
102-
fi
103-
104-
- name: Upload artifact
105-
uses: actions/upload-pages-artifact@v4
106-
with:
107-
path: ./public
43+
# Build website using reusable workflow (always runs for CI)
44+
build:
45+
needs: config
46+
if: github.repository_owner != 'HugoBlox'
47+
uses: ./.github/workflows/build.yml
48+
secrets: inherit
10849

109-
# Deploy website to GitHub Pages hosting
50+
# Deploy website to GitHub Pages hosting (only if configured)
11051
deploy:
111-
if: github.repository_owner != 'HugoBlox'
112-
needs: build
52+
needs: [config, build]
53+
if: needs.config.outputs.deploy-host == 'github-pages'
11354
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
11455
permissions:
11556
pages: write # to deploy to Pages

โ€Ž.github/workflows/upgrade.ymlโ€Ž

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,38 @@ permissions:
1919
contents: write
2020
pull-requests: write
2121

22+
# Prevent duplicate upgrade runs
23+
concurrency:
24+
group: upgrade-${{ github.ref }}
25+
cancel-in-progress: true
26+
2227
jobs:
2328
upgrade:
2429
name: Upgrade
2530
if: github.repository_owner != 'HugoBlox'
2631
runs-on: ubuntu-latest
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
timeout-minutes: 15
2933
steps:
3034
- name: Checkout
3135
uses: actions/checkout@v4
3236
with:
3337
fetch-depth: 0
3438

3539
- name: Setup Node.js
36-
uses: actions/setup-node@v4
40+
uses: actions/setup-node@v6
3741
with:
38-
node-version: '20'
42+
node-version: '22'
3943

4044
- name: Setup pnpm
4145
uses: pnpm/action-setup@v4
4246
with:
43-
package_json_path: templates/data-science-blog/package.json
47+
package_json_path: ./package.json
4448
run_install: false
4549

4650
- name: Setup Go
4751
uses: actions/setup-go@v5
4852
with:
49-
go-version: '1.21'
53+
go-version: '1.23'
5054

5155
- name: Setup Hugo
5256
uses: peaceiris/actions-hugo@v3
@@ -56,6 +60,7 @@ jobs:
5660

5761
- name: Run Upgrade CLI
5862
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5964
# Use manual input or default to stable for scheduled runs
6065
VERSION_TYPE: ${{ inputs.version_type || 'Stable' }}
6166
run: |
@@ -68,6 +73,7 @@ jobs:
6873
echo "Running upgrade with flags: $FLAGS"
6974
pnpm dlx hugoblox@latest upgrade $FLAGS
7075
76+
7177
- name: Create Pull Request
7278
uses: peter-evans/create-pull-request@v6
7379
with:
@@ -84,7 +90,7 @@ jobs:
8490
**Verification:**
8591
- [ ] Check the Deploy Preview to ensure everything looks correct.
8692
- [ ] Merge this PR to apply the updates.
87-
branch: "chore/upgrade-hugoblox"
93+
branch: "chore/upgrade-hugoblox-${{ github.run_id }}"
8894
delete-branch: true
8995
base: main
9096
labels: |

โ€Ž.vscode/extensions.jsonโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"recommendations": [
3-
"lore.lore-studio"
3+
"hugoblox.hugoblox-studio"
44
]
5-
}
5+
}

โ€Žconfig/_default/params.yamlโ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,14 @@ hugoblox:
276276
export_logs: true
277277

278278
# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
279-
# PRO
280-
# Pro subscription features and affiliate program
279+
# PREMIUM
280+
# Premium features and creator program (affiliates)
281281
# โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
282282
pro:
283283
# Hide "Powered by HugoBlox" attribution
284-
# Requires: Pro subscription to support HugoBlox via alternative means
285-
# Note: Even with Pro, you can keep this false to support open source!
286-
# Get Pro: https://hugoblox.com/pro
284+
# Requires: HugoBlox Premium to support HugoBlox via alternative means
285+
# Note: Even with Premium, you can keep this false to support open source!
286+
# Get Premium: https://hugoblox.com/premium
287287
hide_attribution: false
288288

289289
# Affiliate referral code for rewards program

โ€Žgo.modโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.19
44

55
require (
66
github.com/HugoBlox/kit/modules/integrations/netlify v0.0.0-20260102210655-66cba27dc652
7-
github.com/HugoBlox/kit/modules/blox v0.0.0-20260115004143-27742d31a056
7+
github.com/HugoBlox/kit/modules/blox v0.0.0-20260124040029-77f7678f08ac
88
)

โ€Žhugoblox.yamlโ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
build:
22
hugo_version: '0.154.5'
3+
deploy:
4+
# Deployment target: github-pages, netlify, vercel, cloudflare, or none
5+
host: 'github-pages'
36
template:
47
id: "blog"
58
name: "Blog"

0 commit comments

Comments
ย (0)