Closed bep closed 5 months ago
Although I haven't given it a lot of thought, I haven't come up with any exciting use cases for defer blocks either with or without mounting the public directory to something.
I know that #8077 was one of the motivators for defer blocks, but that was before we introduced Page.Store
and documented output format weighting. The backlinks approach described here might be easier to understand if it were rewritten using a defer block per your example above... you could write the data to file instead of stuffing it into a home page Store.
To your original questions...
See the same potential/usefulness as me?
Not yet.
See any (serious) pitfalls?
No.
I know that https://github.com/gohugoio/hugo/issues/8077 was one of the motivators for defer blocks
I think I would rather call it "an example use" for defer blocks. Back links isn't something I'm terribly exited about, but to be effective at scale, it needs some "first class" support in Hugo.
As to defer
, a cleaner way of doing what resources.PostProcess
does today is plenty worth it. And then comes JS splitting.
As to this particular issue, I'm having trouble finding useful examples, so I'll let it linger.
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.
https://gohugo.io/hugo-modules/configuration/#module-configuration-mounts
This idea came when working on #8086.
We need to think a little before doing this, but it would probably be really useful and mind-twisting if I could do:
And then in a template:
@jmooring do you
I have quickly tested it, and the only issue I have seen is that the mount setup checks to see of
source
exist before it mounts it, but that's fixable.