I would like to manipulate the "post_url" tag of Liquid/Jekyll with some variables. These are the two things I would like to do :
Store result into variable
I would like to store the result of post_url in a variable, currently, this does not work :
{%- assign _page_url = post_url 2019-05-19-test -%}
_page_url is empty after this line. :(
Use variable as an argument
But the main issue occurs when I try to use a variable as an argument. _item.post is a variable which contains a string pointing to a correct post.
{%- post_url _item.post -%}
Throw the exception :
Liquid Exception: Could not parse name of post "_item.post" in tag 'post_url'. Make sure the post exists and the name is correct.
Jekyll::Errors::InvalidPostNameError: '_item.post' does not contain valid date and/or title. in /_layouts/page.html Error: Could not parse name of post "_item.post" in tag 'post_url'. Make sure the post exists and the name is correct. Jekyll::Errors::InvalidPostNameError: '_item.post' does not contain valid date and/or title. Error: Run jekyll build --trace for more information.