Closed schnerring closed 3 years ago
I'm not sure what the issue was but I got it working.
The only issue remaining is the part where replacements
only works with [[module.imports]]
but not with setting via theme = [ ... ]
.
but not with setting via theme = [ ... ].
How can you set it there?
You said both were equivalent (correct me if I'm wrong):
This:
[module] [[module.imports]] path = "github.com/yihui/hugo-xmin" [[module.imports]] path = "github.com/yourname/my-shortcodes"
Is the same as:
theme = ["github.com/yihui/hugo-xmin", "github.com/yourname/my-shortcodes" ]
You said both were equivalent (correct me if I'm wrong):
So, your two examples above is equivalent
, but there is no way to add further configuration to the latter example. My memory may be faded here, but you need to pick one or the other.
So replacements
doesn't work for the latter example? If that's as it's intended to work, we can go ahead and close the issue.
So replacements doesn't work for the latter example?
There is no way to add replacements to the latter example, but I suspect I understand where we're talking around each other.
The theme syntax was kept mostly for backwards compability reasons, and I'm pretty sure we don't do any clever merging of the two -- so it's either/or.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
I currently build a theme from scratch that includes an
exampleSite
that I use to develop the theme. I usenpm
to bundleprismjs
which works fine. I also gothugo mod npm pack
working to generate thepackage.config
for myexampleSite/
:I haven't investigated whether or not this behavior is intended but when specifiying the theme with
theme = ["github.com/schnerring/hugo-gruvbox"]
instead of using[[module.imports]]
, thereplacements
functionality doesn't work.The actual bug is that
hugo mod npm pack
doesn't care about thereplacements
part and skips to upstream. This also happens when explicitly usingreplace
inside the.mod
file. This means that one has to push changes upstream first to be able to generate the files withhugo mod npm pack
.This took me a while to figure it out since
replacements
with a local module worked, buthugo mod npm pack
didn't.