Skip to content

Commit

Permalink
fix: use Hugo extended version from .hugo-version
Browse files Browse the repository at this point in the history
- Update build-preview.js to use Hugo version from .hugo-version
- Remove hugo-extended npm dependency
- Add proper version detection and error handling
- Ensure extended version is used for SCSS compilation
  • Loading branch information
rileyseaburg committed Dec 3, 2024
1 parent f6f4945 commit dc75855
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"eslint": "^8.56.0",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"hugo-extended": "^0.121.1",
"list.js": "^2.3.1",
"mime-types": "^2.1.35",
"npm-run-all": "^4.1.5",
Expand Down
12 changes: 9 additions & 3 deletions scripts/build-preview.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
Zconst { execSync } = require('child_process');
cgit adonst { execSync } = require('child_process');
const { copyUswdsAssets } = require('./build-assets');
const fs = require('fs');
const path = require('path');

async function buildPreview() {
try {
// Copy USWDS assets first
await copyUswdsAssets();

// Build the site using the preview config with Hugo extended version
// Get Hugo version from .hugo-version file
const hugoVersion = fs.readFileSync(path.join(__dirname, '../.hugo-version'), 'utf8').trim();
console.log(`Using Hugo version: ${hugoVersion}`);

// Build the site using the preview config
console.log('Building site with preview configuration...');
execSync('npx hugo-extended --config config.yml,config/env/preview/config.yml', {
execSync(`hugo_${hugoVersion} --config config.yml,config/env/preview/config.yml`, {
stdio: 'inherit',
env: {
...process.env,
Expand Down

0 comments on commit dc75855

Please sign in to comment.