Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alphapapa opened this issue Aug 23, 2023 · 3 comments

Comments

@alphapapa
Copy link
Contributor

alphapapa commented Aug 23, 2023

@jarrodmillman @stefanv

While working on #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: #526

@stefanv
Copy link
Contributor

stefanv commented Aug 23, 2023

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

@alphapapa
Copy link
Contributor Author

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

@alphapapa
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants