-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Set and use custom variables in Markdown files and HTML templates #8
Comments
|
To be honest, I don't necessarily need it. It's just something I hope to have in Pelican, because I've been relying on it with Jekyll for several years: https://gitlab.com/TheEvilSkeleton/theevilskeleton.gitlab.io/-/blob/bf07b34709856282bf2ba45ade7b216a23c44e0b/src/_posts/2024-06-03-libadwaita-splitting-gtk-and-design-language.md#L18. I find it really convenient as a blogger.
Bummer, what do you think would be the best alternative? Preferably one that would not need to copy paste the values? |
I think it really depends on the specific use case. For the use case described here — using a summary/description as the first paragraph of the article — I would do the inverse and use the article's first paragraph as the summary by setting |
I see... my articles are generally long, technical, and verbose. The number of paragraphs I write for the summary (or introduction) varies, as you can see at https://tesk.page/posts. Short articles/letters with introductions like this open letter don't have subheadings, so I kinda need the flexibility to place them in Markdown content. |
In that case, I would suggest trying the Summary plugin, which allows you to explicitly specify in the article where the beginning and end of the summary should be. |
Awesome, thanks! |
I'm trying to set variables within Markdown files so I can reuse them in Markdown files and HTML templates.
Say I write an article in Markdown where the file name is
keyboard-review.md
, which contains:Ideally,
{{ Description }}
is supposed to be a variable that I can reuse everywhere within the Markdown file, but it ends up printing nothing. I can only use them in HTML templates.From what I understand, I can use the
{% set %}
statement/function to set and use variables within the same Markdown file, i.e.{% set Description = [...] %}
, but this method has a limitation with the scope, where I can't access them in HTML templates. In other words, one method only works in Markdown files, and the other method only works in HTML templates. I can't find a method that has both.I read the README, and discovered this:
To be honest, I'm not really sure what it means, and whether it's relevant or not.
The text was updated successfully, but these errors were encountered: