build: include Pagefind in package.json for local builds

This commit is contained in:
George Cushen committed 2025-12-31 01:18:09 +00:00
1 parent c086bbbd45
commit 1c1d54bdc3
19 files changed
+46 -34

No files matched your search

+4 -4
View File
@@ -56,9 +56,9 @@ done
# Run Hugo from the site dir so Tailwind CLI is discoverable
cd "templates/$STARTER"
# Ensure Tailwind CLI exists in starter (required for Hugo css.TailwindCSS)
if [ -f "package.json" ] && [ ! -x "node_modules/.bin/tailwindcss" ]; then
echo "📦 Installing Tailwind CLI in starter directory for Hugo..."
# Ensure Tailwind CLI and Pagefind exist in starter (required for Hugo css.TailwindCSS and search indexing)
if [ -f "package.json" ] && { [ ! -x "node_modules/.bin/tailwindcss" ] || [ ! -x "node_modules/.bin/pagefind" ]; }; then
echo "📦 Installing starter dependencies for Hugo..."
if command -v pnpm >/dev/null 2>&1; then
pnpm install
else
@@ -86,7 +86,7 @@ github.com/HugoBlox/hugo-blox-builder/modules/blox-plugin-decap-cms -> ../../../
if [ "$PAGEFIND" = true ]; then
hugo
if command -v pnpm >/dev/null 2>&1; then
pnpm dlx pagefind --site "public" --output-subdir ../static/pagefind
pnpm exec pagefind --site "public" --output-subdir ../static/pagefind
else
npm_config_yes=true npx pagefind --site "public" --output-subdir ../static/pagefind
fi
+1 -1
View File
@@ -98,7 +98,7 @@ jobs:
run: |
# Check if site uses Pagefind search
if [ -f "package.json" ] && grep -q "pagefind" package.json; then
pnpm dlx pagefind --source "public" || npx pagefind --source "public"
pnpm run pagefind || npx pagefind --site "public"
fi
- name: Upload artifact
+3 -3
View File
@@ -14,7 +14,7 @@
hugo --gc --minify -b $URL --logLevel debug --printI18nWarnings --printPathWarnings
echo "=== Running Pagefind indexing ==="
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
echo "=== Build completed successfully ==="
"""
@@ -40,7 +40,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[context.branch-deploy]
@@ -50,7 +50,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[[plugins]]
+3 -1
View File
@@ -6,11 +6,13 @@
"description": "Academic CV starter template for Hugo Blox with Tailwind CSS v4",
"scripts": {
"dev": "hugo server --disableFastRender",
"build": "hugo --minify"
"build": "hugo --minify && pnpm run pagefind",
"pagefind": "pagefind --site public"
},
"dependencies": {
"@tailwindcss/cli": "^4.1.12",
"@tailwindcss/typography": "^0.5.10",
"pagefind": "^1.4.0",
"preact": "^10.27.2",
"tailwindcss": "^4.1.12"
}
+1 -1
View File
@@ -98,7 +98,7 @@ jobs:
run: |
# Check if site uses Pagefind search
if [ -f "package.json" ] && grep -q "pagefind" package.json; then
pnpm dlx pagefind --source "public" || npx pagefind --source "public"
pnpm run pagefind || npx pagefind --site "public"
fi
- name: Upload artifact
+3 -3
View File
@@ -14,7 +14,7 @@
hugo --gc --minify -b $URL --logLevel debug --printI18nWarnings --printPathWarnings
echo "=== Running Pagefind indexing ==="
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
echo "=== Build completed successfully ==="
"""
@@ -40,7 +40,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[context.branch-deploy]
@@ -50,7 +50,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[[plugins]]
+3 -1
View File
@@ -6,11 +6,13 @@
"description": "Blog starter template for Hugo Blox with Tailwind CSS v4",
"scripts": {
"dev": "hugo server --disableFastRender",
"build": "hugo --minify"
"build": "hugo --minify && pnpm run pagefind",
"pagefind": "pagefind --site public"
},
"dependencies": {
"@tailwindcss/cli": "^4.1.12",
"@tailwindcss/typography": "^0.5.10",
"pagefind": "^1.4.0",
"preact": "^10.27.2",
"tailwindcss": "^4.1.12"
}
+1 -1
View File
@@ -98,7 +98,7 @@ jobs:
run: |
# Check if site uses Pagefind search
if [ -f "package.json" ] && grep -q "pagefind" package.json; then
pnpm dlx pagefind --source "public" || npx pagefind --source "public"
pnpm run pagefind || npx pagefind --site "public"
fi
- name: Upload artifact
+3 -3
View File
@@ -14,7 +14,7 @@
hugo --gc --minify -b $URL --logLevel debug --printI18nWarnings --printPathWarnings
echo "=== Running Pagefind indexing ==="
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
echo "=== Build completed successfully ==="
"""
@@ -40,7 +40,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[context.branch-deploy]
@@ -50,7 +50,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[[plugins]]
+3 -1
View File
@@ -6,11 +6,13 @@
"description": "Documentation starter template for Hugo Blox with Tailwind CSS v4",
"scripts": {
"dev": "hugo server --disableFastRender",
"build": "hugo --minify"
"build": "hugo --minify && pnpm run pagefind",
"pagefind": "pagefind --site public"
},
"dependencies": {
"@tailwindcss/cli": "^4.1.12",
"@tailwindcss/typography": "^0.5.10",
"pagefind": "^1.4.0",
"preact": "^10.27.2",
"tailwindcss": "^4.1.12"
}
+1 -1
View File
@@ -98,7 +98,7 @@ jobs:
run: |
# Check if site uses Pagefind search
if [ -f "package.json" ] && grep -q "pagefind" package.json; then
pnpm dlx pagefind --source "public" || npx pagefind --source "public"
pnpm run pagefind || npx pagefind --site "public"
fi
- name: Upload artifact
+3 -3
View File
@@ -14,7 +14,7 @@
hugo --gc --minify -b $URL --logLevel debug --printI18nWarnings --printPathWarnings
echo "=== Running Pagefind indexing ==="
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
echo "=== Build completed successfully ==="
"""
@@ -40,7 +40,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[context.branch-deploy]
@@ -50,7 +50,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[[plugins]]
+3 -1
View File
@@ -6,11 +6,13 @@
"description": "Landing page starter template for Hugo Blox with Tailwind CSS v4",
"scripts": {
"dev": "hugo server --disableFastRender",
"build": "hugo --minify"
"build": "hugo --minify && pnpm run pagefind",
"pagefind": "pagefind --site public"
},
"dependencies": {
"@tailwindcss/cli": "^4.1.12",
"@tailwindcss/typography": "^0.5.10",
"pagefind": "^1.4.0",
"preact": "^10.27.2",
"tailwindcss": "^4.1.12"
}
+1 -1
View File
@@ -98,7 +98,7 @@ jobs:
run: |
# Check if site uses Pagefind search
if [ -f "package.json" ] && grep -q "pagefind" package.json; then
pnpm dlx pagefind --source "public" || npx pagefind --source "public"
pnpm run pagefind || npx pagefind --site "public"
fi
- name: Upload artifact
+3 -3
View File
@@ -14,7 +14,7 @@
hugo --gc --minify -b $URL --logLevel debug --printI18nWarnings --printPathWarnings
echo "=== Running Pagefind indexing ==="
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
echo "=== Build completed successfully ==="
"""
@@ -40,7 +40,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[context.branch-deploy]
@@ -50,7 +50,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[[plugins]]
+3 -1
View File
@@ -6,11 +6,13 @@
"description": "Link-in-bio starter template for Hugo Blox with Tailwind CSS v4",
"scripts": {
"dev": "hugo server --disableFastRender",
"build": "hugo --minify"
"build": "hugo --minify && pnpm run pagefind",
"pagefind": "pagefind --site public"
},
"dependencies": {
"@tailwindcss/cli": "^4.1.12",
"@tailwindcss/typography": "^0.5.10",
"pagefind": "^1.4.0",
"preact": "^10.27.2",
"tailwindcss": "^4.1.12"
}
+1 -1
View File
@@ -98,7 +98,7 @@ jobs:
run: |
# Check if site uses Pagefind search
if [ -f "package.json" ] && grep -q "pagefind" package.json; then
pnpm dlx pagefind --source "public" || npx pagefind --source "public"
pnpm run pagefind || npx pagefind --site "public"
fi
- name: Upload artifact
+3 -3
View File
@@ -14,7 +14,7 @@
hugo --gc --minify -b $URL --logLevel debug --printI18nWarnings --printPathWarnings
echo "=== Running Pagefind indexing ==="
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
echo "=== Build completed successfully ==="
"""
@@ -40,7 +40,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[context.branch-deploy]
@@ -50,7 +50,7 @@
echo "Deploy URL: $DEPLOY_PRIME_URL"
pnpm install --verbose --no-frozen-lockfile
hugo --gc --minify -b $DEPLOY_PRIME_URL --logLevel debug --printI18nWarnings --printPathWarnings
pnpm dlx pagefind --source 'public' --verbose
pnpm run pagefind -- --verbose
"""
[[plugins]]
+3 -1
View File
@@ -6,11 +6,13 @@
"description": "Resume starter template for Hugo Blox with Tailwind CSS v4",
"scripts": {
"dev": "hugo server --disableFastRender",
"build": "hugo --minify"
"build": "hugo --minify && pnpm run pagefind",
"pagefind": "pagefind --site public"
},
"dependencies": {
"@tailwindcss/cli": "^4.1.12",
"@tailwindcss/typography": "^0.5.10",
"pagefind": "^1.4.0",
"preact": "^10.27.2",
"tailwindcss": "^4.1.12"
}