1
votes

Is there a way to summon the description of post B (which is stated in its front matter) in post A?

The liquid tag {{page.description}} summons only the description of post A. Is there a way to include an url or something, thus using liquid tags across different files?

Or is there a better way to do this?

1

1 Answers

3
votes

Unfortunately, front-matter variables are only accessible from within that file.

Between these triple-dashed lines, you can set predefined variables (see below for a reference) or even create custom ones of your own. These variables will then be available to you to access using Liquid tags both further down in the file and also in any layouts or includes that the page or post in question relies on.

Jekyll documentation

However, you can work around this for posts by looping through every post and including only what you want using an if statement.

{% for post in site.posts %}
{% if post.title == "Desired Post Title" %}
{{ post.description }}
{% endif %}
{% endfor %}