Skip to content

Commit 2f1f00a

Browse files
committed
fix(build): resolve Docsy 0.16.0 vendor deps via npm workspace
1 parent 17e1942 commit 2f1f00a

4 files changed

Lines changed: 39 additions & 2 deletions

File tree

‎.github/scripts/build-site.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ mkdir -p "$HUGO_CACHEDIR" "$OUTPUT_DIR" "$npm_config_cache"
3636
git config --global --add safe.directory /src
3737
git config --global core.quotepath false
3838

39+
# Docsy 0.16.0 theme module mounts expect node_modules/ at the project root
40+
# (e.g. node_modules/bootstrap -> assets/vendor/bootstrap). PostCSS tooling
41+
# and theme dependencies are installed at /tmp/node_modules by the Dockerfile;
42+
# symlink so Hugo module mounts resolve them at the project root.
43+
if [ ! -e node_modules ]; then
44+
ln -s /tmp/node_modules node_modules
45+
fi
46+
3947
set -- build \
4048
--gc \
4149
--minify \

‎Dockerfile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ RUN git config --global --add safe.directory /src
3535
# python3 is required for uv to create a venv when running scripts with inline metadata.
3636
RUN apk add --no-cache nodejs npm go python3
3737

38-
# Install front-end tooling.
38+
# Install front-end tooling and Docsy theme npm dependencies (Bootstrap, Font
39+
# Awesome) into /tmp/node_modules. The packages/ workspace directory is
40+
# required so npm ci processes the hugoautogen workspace that Hugo generates
41+
# via "hugo mod npm pack"; without it @fortawesome/fontawesome-free is missing
42+
# and Docsy 0.16.0's module mounts fail.
3943
COPY package.json package-lock.json /tmp/
44+
COPY packages/ /tmp/packages/
4045
RUN --mount=type=cache,target=/root/.npm \
4146
cd /tmp && npm ci
4247

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ render-site-isolated : build
5656
-v "$(HUGO_ISOLATED_CACHE_HOST_DIR)":"$(HUGO_ISOLATED_CACHE_CONTAINER_DIR)":rw \
5757
-w /tmp \
5858
$(HUGO_IMAGE) \
59-
-lc 'cp -a /workspace /tmp/src && git config --global --add safe.directory /tmp/src && cd /tmp/src && hugo build --gc --minify --cacheDir "$(HUGO_ISOLATED_CACHE_CONTAINER_DIR)" -d /tmp/public --noBuildLock'
59+
-lc 'cp -a /workspace /tmp/src && git config --global --add safe.directory /tmp/src && cd /tmp/src && ln -s /tmp/node_modules node_modules && hugo build --gc --minify --cacheDir "$(HUGO_ISOLATED_CACHE_CONTAINER_DIR)" -d /tmp/public --noBuildLock'
6060

6161
## publications-json: generate Hugo data/publications.json from BibTeX.
6262
publications-json : build

‎package-lock.json‎

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)