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

Turning docsy theme into a hugo module #801

Merged
merged 1 commit into from
Jan 13, 2022
Merged

Turning docsy theme into a hugo module #801

merged 1 commit into from
Jan 13, 2022

Conversation

deining
Copy link
Collaborator

@deining deining commented Dec 10, 2021

This is my final approach to bringing hugo modules to docsy theme. This PR supersedes my previous attempt #520. This PR is the module part only, docu was submitted separately with PR #802.
Motivation behind my PR was already explained here. From the discussion at #535, I learned that this PR will be (hopefully!) appreciated by the Docsy community. A recent blog post about conversion from git submodule to hugo modules can serve as additional reference, I fully agree with what is stated in this blog post (citation):

Git submodules are cumbersome to manage.
In my opinion, git submodules are a sort of anti-pattern for Hugo
(I know many themes suggest using git submodules).
There’s a better way to manage your Hugo site’s theme: Hugo Modules.

Please note, that this PR is not ready for review yet, also the checks after submitting the PR will fail. That's due to the fact that inside my go.mod, I'm missing a recent commit hash that I can refer to.
There are different approaches to get this PR ready so that reviewers and/or community can try it out:

I hope that my PR will be well received and that it will be accepted eventually. I can't guarantee for a completely smooth transition from submodules to hugo modules, but I'm sure we can iron the wrinkles out and doing the transition is worthwile.
If you are curious, you my read my documentation submitted with PR #802.

@deining deining changed the title Turning docsy theme into a hugo module Turning docsy theme into a hugo module -WIP- Dec 10, 2021
@deining deining changed the title Turning docsy theme into a hugo module -WIP- Turning docsy theme into a hugo module Jan 12, 2022
@deining
Copy link
Collaborator Author

deining commented Jan 12, 2022

I just reworked and rebased my PR and IMHO it is now ready to be merged.

What I did:

config.toml:

[[module.imports]]
  path = "github.com/twbs/bootstrap"
[[module.imports.mounts]]
  source = "scss"
  target = "assets/vendor/bootstrap/scss"
[[module.imports]]
  path = "github.com/FortAwesome/Font-Awesome"
[[module.imports.mounts]]
  source = "scss"
  target = "assets/vendor/Font-Awesome/scss"

Successful deploy in Netlify, using Hugo Modules

config.toml, imports deactivated:

[[module.imports]]
  path = "github.com/twbs/bootstrap"
  disable = true
[[module.imports.mounts]]
  source = "scss"
  target = "assets/vendor/bootstrap/scss"

[[module.imports]]
  path = "github.com/FortAwesome/Font-Awesome"
  disable = true
[[module.imports.mounts]]
  source = "scss"
  target = "assets/vendor/Font-Awesome/scss"

Successful deploy in Netlify, using git submodules

So this is essentially the proof that you can switch back and forth between Hugo modules and git submodules easily, all you have to do is to set disable = true/false on two places inside config.toml.

@LisaFC: I'm very confident we can merge this PR into master without breaking anything. In my PR, I set disable = true, with this conservative setting, users won't see any difference when using the module as submodule or via git clone.

@LisaFC
Copy link
Collaborator

LisaFC commented Jan 13, 2022

Oh this is great! I think we're safe to merge this now with the feature switched off as default and then we can look at the docs, default approach, etc. etc.

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

Successfully merging this pull request may close these issues.

None yet

2 participants