-
Notifications
You must be signed in to change notification settings - Fork 367
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
Turn theme into a hugo module #134
Conversation
Hey,
thanks for the contribution again!
I definitely like the idea.
Feel free to continue with the implementation.
…On Sat, Mar 5, 2022, 8:41 AM Andreas Deininger ***@***.***> wrote:
This PR turns hugo-fresh into a hugo module. This way, the theme can pull
in dependency bulma as go module.
With this PR in place, setting up a new site based on hugo-fresh can be
done via:
hugo new site my-site
cd my-site
hugo mod init github.com/me/my-site
hugo mod get github.com/StefMa/hugo-fresh #optional
echo 'theme = "github.com/StefMa/hugo-fresh" >> config.toml
hugo serve
*Note:* This PR is work in progress. The concept works: with this PR
applied, you can preview the exampleSite simply via hugo server (no
themesDir=../.. needed any more). If you like the idea, I'm willing to
refine the implementation and add the documentation for the new route to
install hugo-fresh.
------------------------------
You can view, comment on, or merge this pull request online at:
#134
Commit Summary
- 2a0489b
<2a0489b>
Turn theme into a hugo module
File Changes
(6 files <https://github.com/StefMa/hugo-fresh/pull/134/files>)
- *A* config.yaml
<https://github.com/StefMa/hugo-fresh/pull/134/files#diff-d8d0422389f03d783e32e627250fe29834bd09c6361640d1ff00661dd6820034>
(26)
- *M* exampleSite/config.yaml
<https://github.com/StefMa/hugo-fresh/pull/134/files#diff-1926bed36200257684beefb9e338d8dc0679b7226f1cb4290fb677139853dfb9>
(3)
- *A* exampleSite/go.mod
<https://github.com/StefMa/hugo-fresh/pull/134/files#diff-5bed2c958464666aa841aecfa747db471387119abc35bb3fbb729565aaac8818>
(7)
- *A* exampleSite/go.sum
<https://github.com/StefMa/hugo-fresh/pull/134/files#diff-f6be75f6781e07f5e910f0302efdca04702663d15147714c0d422cc7fadbf156>
(3)
- *A* go.mod
<https://github.com/StefMa/hugo-fresh/pull/134/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6>
(5)
- *A* go.sum
<https://github.com/StefMa/hugo-fresh/pull/134/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63>
(2)
Patch Links:
- https://github.com/StefMa/hugo-fresh/pull/134.patch
- https://github.com/StefMa/hugo-fresh/pull/134.diff
—
Reply to this email directly, view it on GitHub
<#134>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOBQ67XP2IUIY24N5BTZR3U6MFY3ANCNFSM5P7K7MYA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hey @deining . |
bf574b7
to
ea2b8bd
Compare
Yes, I am. Sorry, this flew under my radar for a long time!
I realized that bulma is at version 0.9.4 meanwhile (my original PR was for 0.9.3). I corrected my PR, it now targets bulma 0.9.4.
Yes. CircleCi now fails with this message:
Can you add Furthermore: With my PR in place, we have two installation approaches now: hugo module vs. git submodule. The problem with that is, that both approaches are out sync concerning So we have two choices:
You are the repo owner, you have to decide which of the tweo proposed ways you want to go. Two more notes:
|
Thanks @deining and thank you for all the information you provide here 🙏 Regarding CircleCI: Regarding two versions (submodule and modules) I would go the "all-in hugo modules" way.
Yep, I also realized this and probably move the documentation more prominent to the README.
You mean I should not be part of the repository, right? 🤔 |
Thanks @deining and thank you for all the information you provide here 🙏 Regarding CircleCI: Regarding two versions (submodule and modules) I would go the "all-in hugo modules" way.
Yep, I also realized this and probably move the documentation more prominent to the README.
You mean it should not be part of the repository, right? 🤔 |
Wise decision!
Yes, I will come back to this once migration to GitHub actions is done! |
I removed all remnants of the git submodule + local bulma installation I could find.
That's a goo idea and would, go ahead with this. I'm done here too, handing over to your for approval/finalization. |
7c769b3
to
1907474
Compare
7aa10b3
to
34ca4a5
Compare
This way, the theme pulls in dependency 'bulma' as go module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, we did it 🚀
Thanks again @deining.
This moves the theme to the next level.
# and mount points are declared | ||
module: | ||
imports: | ||
- path: github.com/jgthms/bulma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A follow-up question regarding this here @deining .
We now pull always the latest main
/master
branch from bulma right? 🤔
Can we also specify a git tag
? 🤔
Like github.com/jgthms/[email protected]
I guess this is more stable than always pulling a develop branch?! 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now pull always the latest
main
/master
branch from bulma right?
No. we pull in 0.9.4
right now.
The bulma version used is defined in go.mod
:
Line 5 in 7987c63
require github.com/jgthms/bulma v0.0.0-20220508134905-3e00a8e6d0d0 // indirect |
To update bulma inside your theme use this command:
hugo mod get -u github.com/jgthms/bulma@9734c65c100 # commit hash
Instead of a commit, you can also use a version (the tag should have leading v though (e.g. v0.9.4)):
As an example, the command below can be used by users of your theme to update their theme version used:
hugo mod get -u github.com/StefMa/[email protected]
This only works of course if you start using tags like vn.n. What about tagging this first module version with v0.1
or so?
Hope that clarifies things!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much.
Yes, that helped quite a lot.
Its sad that the go.mod
didn't show the git tag but the hash instead 😭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its sad that the
go.mod
didn't show the git tag but the hash instead
If the name of the tag in the bulma repo were v0.9.4
instead of 0.9.4
, you would see it.
So if you want that users of your theme see the tag instead of the hash, but better tag the inital module release with v1.0
instead of 1.0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much again 🙂
Here we are: https://github.com/StefMa/hugo-fresh/releases/tag/v1.0.0
With that I have a go.mod and go.sum client like that:
// go.mod
require github.com/StefMa/hugo-fresh v1.0.0 // indirect
// go.sum
github.com/StefMa/hugo-fresh v1.0.0 h1:Nxo9WtzfBlaFi1G8NEHQLReJQz+Dn4jRxec+lMrPG6k=
github.com/StefMa/hugo-fresh v1.0.0/go.mod h1:yRzHyco0bfnITjvq7rfAiOADfGMrDlM0kXeKBllUJEc=
github.com/jgthms/bulma v0.0.0-20220508134905-3e00a8e6d0d0/go.mod h1:89FLBKXYFKfOKAoDeUT26V0pHGwzr205cMXAEqtAVOI=
This PR turns
hugo-fresh
into a hugo module. This way, the theme can pull in dependencybulma
as go module.With this PR in place, setting up a new site based on
hugo-fresh
can be done via:Note: This PR is work in progress. The concept works: with this PR applied, you can preview the exampleSite simply via
hugo server
(nothemesDir=../..
needed any more). If you like the idea, I'm willing to refine the implementation and add the documentation for the new route to installhugo-fresh
.