2.0 KiB
2.0 KiB
Hugo/Blowfish Troubleshooting & Pitfalls
1. Infinite Rebuild Loops
If Hugo triggers a rebuild loop:
- Cause: Hugo watches the
resources/directory, and the generation of cached/busted assets (likeadmonitions.scss_...json) triggers a new rebuild event. - Fix: Add the following to
config/_default/hugo.toml:[watch] ignore = ["resources/**"] - Tool Usage: If the loop persists, start the server with polling to reduce sensitivity:
hugo server --poll 1s
2. Table of Contents (TOC) Issues
Blowfish manages TOC natively via params.toml. Avoid using manual [TOC] or {{< toc >}} in your Markdown unless explicitly required by a specific layout.
- Standard Setup: Ensure
showTableOfContents = trueis set in the[article]and[list]sections of yourconfig/_default/params.toml. - Custom Layouts: If TOC is rendering in the wrong place, it is likely due to an overridden
layouts/_default/single.html. Revert to the native theme structure (containerandproseclasses) so the Blowfish partials can handle the placement. - TOC ScrollSpy Highlighting: If the TOC fails to highlight active headings when scrolling, verify that
smartTOC = trueis enabled inparams.toml. If it is nested inside the[article]section, ensure that thelayouts/partials/toc.htmlchecks:{{ if or .Site.Params.smartTOC .Site.Params.article.smartTOC }}to correctly resolve the nested parameter.
3. Theme Updates & Customization
- Version mismatch: When Hugo updates, theme templates often break (e.g.,
can't evaluate field Locale). - Decoupled Theme Installation: The theme is fully decoupled/vendored in the root folders. If you need to update Blowfish, you will copy/vendor the new templates into
layouts/and assets intoassets/, but you must review custom changes to templates such aslayouts/_default/single.htmlandlayouts/partials/toc.htmlto make sure custom styles and scripts (like multiple TOC elements or active highlight overrides) are preserved.