diff --git a/.github/workflows/links.yaml b/.github/workflows/links.yaml index 88322da869..42a8941302 100644 --- a/.github/workflows/links.yaml +++ b/.github/workflows/links.yaml @@ -27,7 +27,7 @@ jobs: cache: npm cache-dependency-path: package.json - - run: npm install --omit=optional + - run: npm run install:all - name: Install lychee env: @@ -44,5 +44,11 @@ jobs: GITHUB_TOKEN: ${{ github.token }} run: npm run check:links - - name: Verify committed cache and generated files are unchanged - run: npm run check:generated + - name: Verify the committed cache is unchanged + run: | + npm run _diff:check || { + echo + echo 'ERROR: cache changed; regenerate locally (npm run check:links) and commit.' + echo + exit 1 + } diff --git a/.gitignore b/.gitignore index f990f9dd69..ecfc7f87e3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,4 @@ resources/ node_modules/ package-lock.json .hugo_build.lock -# Volatile staleness marker from `hugo mod npm pack` (its hash churns on any -# package.json change); the sibling package.json that npm needs stays committed. -packages/hugoautogen/hugo_packagemeta.json +packages/hugoautogen/ diff --git a/.lycheecache b/.lycheecache index a7a1dba3f2..0a614b2ae7 100644 --- a/.lycheecache +++ b/.lycheecache @@ -18,7 +18,7 @@ https://example.docsy.dev/blog/,200,1782763743 https://example.docsy.dev/blog/news/,200,1782763743 https://example.docsy.dev/blog/releases/,200,1782763744 https://example.docsy.dev/community/,200,1782763743 -https://example.docsy.dev/docs/,200,1782763743 +https://example.docsy.dev/docs/,200,1782926753 https://example.docsy.dev/docs/getting-started/,200,1782763743 https://example.docsy.dev/docs/reference/,200,1782763744 https://example.docsy.dev/docs/tasks/,200,1782763744 diff --git a/README.md b/README.md index 4de90855c9..dffb484ad1 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,6 @@ configuration settings do in the Once your settings are adjusted, you can edit your own versions of the site’s source files. -If you want to do SCSS edits and want to publish these, you need to install -`PostCSS` - -```bash -npm install -``` - ## Running the website locally Building and running the site locally requires a recent `extended` version of @@ -68,7 +61,14 @@ your environment in our guide. Once you've made your working copy of the site repo, from the repo root folder, -run: +first install the npm dependencies, including the Bootstrap and Font Awesome +assets that the theme sources as npm packages: + +```bash +npm run install:all +``` + +Then run: ```bash hugo server diff --git a/netlify.toml b/netlify.toml index 7898ef86a6..68ad5219ca 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,11 +2,11 @@ # (https://gohugo.io/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify) [build] -command = "npm run build:preview" +command = "npm run install:all && npm run build:preview" publish = "public" [build.environment] GO_VERSION = "1.22.2" [context.production] -command = "npm run build:production" +command = "npm run install:all && npm run build:production" diff --git a/package.json b/package.json index b7bc7b1aec..cf15ce447b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "_check:links": "npx lychee-norm-cache", "_commit:public": "HASH=$(git rev-parse --short main); cd public && git add -A && git commit --allow-empty -m \"Site at $HASH\"", "_diff:check": "git diff --name-only --exit-code", - "_diff:fail": "npm run _diff:check || (echo; echo 'ERROR: committed files above changed during CI. Regenerate locally (npm run check:links; npm run update:docsy:pack) and commit.'; echo; exit 1)", "_fix:permissions": "chmod -R u+w public/* 2>/dev/null || true", "_get:docsy": "hugo mod get github.com/google/docsy/theme@v$npm_package_version", "_hugo-dev": "npm run _hugo -- -e dev --logLevel info -DFE", @@ -28,7 +27,6 @@ "build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"", "build:production": "npm run _hugo -- --minify", "build": "npm run _build -- ", - "check:generated": "hugo mod npm pack && npm run _diff:fail", "check:links:internal": "npm run _check:links -- --offline", "check:links": "npm run _check:links", "ci:prepare": "npm run _get:docsy && hugo mod graph && hugo mod tidy", @@ -37,6 +35,7 @@ "fix:format:diff": "npm run fix:format", "fix:format": "npm run _check:format -- --write", "fix": "npm run fix:format", + "install:all": "echo 'INFO: first install is for hugo from hugo-extended' && npm install && hugo mod npm pack && npm install", "local": "npm run _local -- npm run", "make:public": "git init -b main public", "post_hugo": "npm run _fix:permissions", diff --git a/packages/hugoautogen/package.json b/packages/hugoautogen/package.json deleted file mode 100644 index 7708b29db6..0000000000 --- a/packages/hugoautogen/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dependencies": { - "@fortawesome/fontawesome-free": "6.7.2", - "bootstrap": "5.3.8" - }, - "devDependencies": {}, - "name": "docsy-example", - "version": "0.1.0" -}