-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Nested bundles use-case #20
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! I am really enjoying these little bundles of joy.
I'm rebuilding a site and wanted to take advantage of this plugin. I have some one-off layouts for which the
<head>
content is different in terms of styles and scripts, and various tags (say<link>
), so I can adjust what goes in the template for the head (lots of common tags like the title, icon, meta… justify not having duplicated files).Here's my very simple
<head>
template:Now, here's my default
base.njk
layout:And with my one-off template, I could use it like this:
The reason I can't reuse the very same setup is due to the fact I run PurgeCSS as a transform, and I cache my bundles, so they are reused across the site if the name is identical. I could use a unique bundle name (
head-base'
,'head-one-off'
…) for my JS and CSS per layout but that seems a little gross and not scalable to add them in there. (I need scalability for my 3 layouts, of course 🙃)I did try to see if it worked and while every element built out as I expected, the contents of those CSS and JS elements were a comment which I assume is replaced by a transform after the fact.
Currently I've worked around the problem by assigning
{% block head %}{% endblock %}
in myhead.njk
file and replace the{% html "head" %}
with{% block head %}
. That works fine in my case, but just wanted to make sure I reported a valid use-case regardless (well, valid enough in my eyes, perhaps!).Thank you!
The text was updated successfully, but these errors were encountered: