-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Idea: allow transclusion via include tag #6789
Comments
I see what you mean. Hugo can do that: it allows you to access what you have called |
To summarize, this feature-request is enhance the My initial impression is that this request is best handled as a separate plugin.. (or a new tag within the Core itself). It can't be incorporated into the existing |
Is that possible? Wouldn't it need to be something different like |
Yep the best bet is to implement a new tag altogether. Either ways, this is best seen as a plugin-case. |
@ashmaroli Is right; this is probably best implemented as a plugin. It wouldn’t make sense as an upstream feature request to Liquid, because the |
I initially assumed this may progress up to the Liquid repo since there's an include tag, but if that's different from what Jekyll is using then ultimately this idea will probably stay here. I'm glad this issue is generating some conversation though. Here's another very practical example of how this sort of feature would be useful:
Would allow reuse of a generic component include that could easily be used hundreds of times in a project like a design system. Being able to avoid writing a |
@cmegown The Coming back here, do note, there's no point discussing on the merits of the idea, any further. Sorry. |
Yep, I understand this concept won't be rolled into the core but a couple of comments mentioned this could be implemented via plugin. I don't possess the ability to do the work myself, but if anyone else is interested in taking on the work I wanted to provide another example of how it might work. |
As @ashmaroli mentioned, this is a custom Shopify tag, just like Jekyll has its own custom Liquid tag. Vanilla Liquid has no
Edit: Not closing, since it seems @ashmaroli is plotting something |
@cmegown My sincere apologies if shot you down. The issue will remain open.. do send the word out to our enthusiastic community.. Somebody will take up on the challenge. |
@ashmaroli Nope, don't worry about it. I actually learned that the Shopify theme docs and the Liquid docs are different things 🙃 While I may not be able to write the plugin myself I would certainly be interested in helping any way I can. |
I'm two years late, but I needed something similar for my blog. I present to you jekyll-transclude.rb. Credits go to Corey for the original idea and syntax. I'm a Ruby noob, so please don't judge me 😄 |
Hi everyone,
Right off the bat I want to say that this is less an official feature request as much as it's something I feel might merit a discussion. It's also worth noting that I'm creating this issue here first, rather than going straight to the liquid issues, even if that's where we end up.
I've been using Jekyll to build out a design system and while creating "living" components I'm seeing some room for improvement when it comes to including "dynamic" content. Here's a very simple version of what I'm talking about:
The snippet above works just fine if you want the caption to be a simple string, but if you want to use additional HTML elements then you need to utilize a
{% capture %}
block:While this works fine as is, having to write an additional
{% capture %}
block frequently can be tedious and prone to error. Here's how allowing for a transclusion slot (here's an example of transclusion in Angular) might work:In the example above, you can see there's a new predefined variable called
include_content
being used for this purpose. Again, this is just an idea. Feel free to immediately disregard and close this issue but I'd love to hear some feedback and see what everyone else thinks.The text was updated successfully, but these errors were encountered: