-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
RFE: Make it possible to include content files from other content files #1902
Comments
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
hello? Is this syntax can only be used in markdown files? or any kind of textfiles, like .rst or plain .txt, in the content folder? |
I've used a .html file to test it. As far as I can tell the curly braces syntax (also {filename}, {category}) can be used in any kind of text file. I still need to hear code review from the project maintainers though. |
@mitchtbaum - I've received a notification about you commenting on this issue but the comment got lost somehow. |
@atodorov: Sorry about that. I had started to comment, and somehow this form submitted before finishing it, so I wrote another one saying that happened and deleted both. #tangled-web-problems I looked further into this, and aside from Pelican's current link syntax and potential additions and improvements which we can address in another issue, I believe I have already produced a good solution for your use case. I need to fix upstream dependencies so I can make stable links to it (here and in Pelican's plugin meta-repo) and finish documentation, so I am working on that now. // Temporarily, you can find usable, pre-released code in https://github.com/mitchtbaum?tab=repositories // In a nutshell, you would create a 'notice' (article with that category) for each one you want to use, and you would reference your desired notice from any article with a
How would that work for you? Aside: You can see a small writeup before I had worked out this Note: edited Jinja example to add div wrapper and changed styling to wrap only leading text saying what it is. |
It won't as far as I can understand. Correct me if I'm wrong but your solution requires me to have a template in which to reference the text I need to include, right ? What I want to do is include text inside my content files (e.g. html pages or markdown posts). I don't want to mess about with templates. |
References take place only in content. They are simple key-value pairs going from one piece of content to another using metadata. So for instance, When your content (markdown, etc) gets rendered into a desired output (html, etc), it will go wherever you put it and have whatever style you give it, as per your theme. imho, data feels most comfortable (so to speak) when it is kept separate from any logic about where to put it and how it could look. |
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
I wrote the jinja2content plugin for this purpose. You can see it in action here. The file includes several others by using a jinja2 The plugin also provides full jinja2 functionality (before the theme's templates are rendered, so the content that is passed onto the plugin does not have the cc. @mitchtbaum |
PR #1909 was submitted to address this and is currently awaiting review from @getpelican/reviewers. |
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
The new {include} syntax makes it possible to include frequently used text snippets into your content.
Hi guys,
I have several pages which have the same boiler plate text. It's a warning/disclaimer notice which gets included where necessary. As far as I can see it is not possible to do this inside my content files.
For example instead of linking to another file with
[disclaimer]({filename}disclaimer.md]
I want to be able to write{include}disclaimer.md
and the text will be automatically included in the current page being processed.Please let me know if this exists (or partially exists). I intend to work on this feature b/c I need it.
The text was updated successfully, but these errors were encountered: