Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

created site doesn't process liquid tags in posts when shown on homepage #246

Closed
WalkerCodeRanger opened this issue May 6, 2015 · 4 comments

Comments

@WalkerCodeRanger
Copy link

Using pretzel 0.2.1.169 (build 175) which I downloaded from Appveyor (non script cs zip), the posts that are shown on the main page of the site do not have liquid tags processed. Not sure if this is an issue with the use of {{ post.content }} to include the content of the post on the homepage or if there is an actual bug in pretzel.

Steps to reproduce

  1. pretzel create
  2. edit _posts\2015-05-05-myfirstpost.md to add {% post_url 2015-05-05-myfirstpost %} before hello world
  3. pretzel taste

On the homepage under the post title, you will see "{% post_url 2015-05-05-myfirstpost %}" this should be processed into a url for the post.

@laedit
Copy link
Member

laedit commented May 20, 2015

Nice catch, this is a hard one!

@JakeGinnivan , @shiftkey it seems that it is not possible to use liquid or razor in a post content, only in a template or a page, is this wanted?

@JakeGinnivan
Copy link
Member

Pretty sure this is expected. liquid/razor are templating languages and markdown is the content renderer.

markdown does not support liquid/razor syntax. You could name your file _posts\2015-05-05-myfirstpost.cshtml and then I would expect that file to be processed by razor, but then you wouldn't be able to use markdown

@laedit
Copy link
Member

laedit commented May 20, 2015

Sorry, I don't know what I was thinking, my message was confusing: by default with the create method the index page is a index.md file containing a lot of liquid or razor code and it is generated correctly.
And you can use a liquid or razor code in the post files, the generated post file are correct, the liquid/razor code is correctly interpreted.
But on the homepage, which list some of the posts, the liquid/razor code is not interpreted, Pretzel use the raw content of the post file.

I haven't successfully tested it on Jekyll but I think it is a bug on Pretzel side.
And we have another bug wich prevent to use any quotes in the tags/filters: the " char is transformed in his html equivalent ".

@eoner
Copy link

eoner commented Aug 14, 2015

This is really annoying when you try to host a blog in a subdirectory, so if anyone is having problems with this, there is a workaround/hack you can apply until a proper fix comes along:

Simply repeat the call at line 191 of src / Pretzel.Logic / Templating / JekyllEngineBase.cs like this:

context.Content = RenderTemplate(context.Content, context);
// render again
context.Content = RenderTemplate(context.Content, context);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants