numpy.org icon indicating copy to clipboard operation
numpy.org copied to clipboard

Makefile's `serve` rule checks out submodules, making testing theme changes difficult

Open alphapapa opened this issue 1 year ago • 3 comments

@jarrodmillman @stefanv

While working on https://github.com/numpy/numpy.org/pull/668, I noticed again that the Makefile's serve rule calls git submodule update. Since the https://github.com/scientific-python/scientific-python-hugo-theme repo is a submodule in the numpy.org and scientific-python.org repos, this makes it a bit more difficult to test theme changes against these sites, because calling make serve tries to set the theme submodules back to what the "superproject" (in git-submodule terms) expects, rather than what the theme developer may have temporarily checked out in the submodule repository.

Both the numpy.org and scientific-python.org repos' Makefiles have a serve-dev rule. In each one, the only difference from the serve rule is that it adds the argument --disableFastRender (which is a Hugo option that affects how it serves the pages locally). I wonder if it would be appropriate to also use the serve-dev rule to not force the submodules to be updated; rather, we could just print a warning if the submodules aren't what's expected. This would allow the theme developer to use a different checkout in the submodule more easily.

Please let me know what you think about this idea. If it sounds good, I'll update the Makefiles accordingly. Thanks.

See also: https://github.com/numpy/numpy.org/pull/526

alphapapa avatar Aug 23 '23 22:08 alphapapa

I think that's a good idea, thanks @alphapapa. I often run into this problem.

stefanv avatar Aug 23 '23 23:08 stefanv

Here's what I'm using at the moment:

# Serve for development purposes (without the "prepare" step, which
# updates submodules.  Also, use --poll to workaround
# <https://github.com/gohugoio/hugo/issues/10893>).
# TODO: Make this rule common among related projects' Makefiles.
serve-dev:
	hugo --printI18nWarnings server --disableFastRender --poll 1000ms
  • [ ] Question: Would this issue be best placed in the https://github.com/scientific-python/scientific-python-hugo-theme repo, or...? It could serve as a meta-issue for adding it to each relevant Makefile. @stefanv @jarrodmillman

alphapapa avatar Oct 06 '23 06:10 alphapapa

@jarrodmillman I don't have write access to this repo, so would you please transfer this issue to the https://github.com/scientific-python/scientific-python-hugo-theme repo? I'd like to use it as a meta-issue to track fixing this problem in each downstream Makefile.

alphapapa avatar Oct 11 '23 16:10 alphapapa