Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions common/common.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ builddir:
.PHONY: html-setup
html-setup:
$(Q)git submodule update --init
# Revert any theme patch from a previous build. The EN and JA patches touch the
# same lines of header.html, so without this an EN build in a tree last used for
# a JA build (or vice versa) keeps the wrong language's nav links.
$(Q)cd ../mkdocs-material; git checkout -- material/base.html material/partials/header.html

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed the bug reproduces and this fixes it. Thanks.
I have one suggestion on it: --force instead of the explicit file list**

git submodule update --force runs checkout --force in the submodule, which reverts the patch for any file it touched, so the two-line change collapses into a modification of the existing line:

	$(Q)git submodule --quiet update --init --force

The hardcoded base.html / header.html list is correct today, but it has to be kept in sync with the patches by hand — add a third file to a future theme patch and this silently goes stale. --quiet keeps the build output as it is now.

Checked against the real submodule: no fetch needed when the pinned SHA is already local, first-time init unchanged, and it's slightly faster than the checkout -- form on a warm tree. Only behavioral difference is that it also reverts unrelated hand-edits inside mkdocs-material, which the patch files are the sanctioned alternative to anyway.

-cd ../mkdocs-material; patch -p1 < $(PATCH) --ignore-whitespace -N
$(Q)cp -a $(SRC)/* build/html/
$(Q)cp ../common/*.png build/html/
Expand Down
Loading