DougBeney / jekyll-pug

Jekyll Plugin That Allows You To Use Pug
MIT License
37 stars 2 forks source link

Pug does not get run on index.pug #19

Closed chrisjohnhopkins closed 2 years ago

chrisjohnhopkins commented 6 years ago

I have set up pug successfully on my layouts folder. That all works fine.

However when i rename index.md to index.pug it seems this does not work how the docs suggest.

If i write..

`--- title: Home Page layout: default

p Welcome to my home page. Isn't it awesome?`

This is not added inside a paragraph tag. The 'p' is output to the screen.

DougBeney commented 6 years ago

Hi, Chris. Thank you for reporting this.

I am no longer working on Jekyll-Pug and instead work on Jekyll-Bliss. It is faster than Jekyll-Pug anyway.

This is an unfortunate issue. I tried it myself and the plugin seems to be broken. Jekyll probably changes some things around in an update which broke things.

If anyone wants to fix this, feel free to hack around with the source code. I made it pretty clean and organized, but let me know if you're confused about something. I'll be happy to point you in the right direction.

Tl;DR: Everyone should consider using Jekyll-Bliss instead.

EDIT: To be clear, if anyone cares to submit a pull request to fix this particular gem, I am open to it.

chrisjohnhopkins commented 6 years ago

Thanks very much for the quick response. I shall checkout Jekyll-Bliss.

DougBeney commented 6 years ago

Just updated the Jekyll-Pug website to with documentation and instruction on using Jekyll-Bliss: http://jekyll-pug.dougie.io/

ErikBjare commented 2 years ago

This plugin works 99% perfect (and better than Jekyll-bliss for me, which I've had several issues with) for both my personal site (https://github.com/ErikBjare/erikbjare.github.io) and the site for ActivityWatch (https://github.com/ActivityWatch/activitywatch.github.io).

But, for some strange reason, there's a single pug file which does not render correctly on the ActivityWatch site. The others work just fine, however, so something weird is happening there...

Would love it if you could throw a quick eye on this @DougBeney.

Edit: and if you're really not maintaining this anymore, perhaps put up a banner in the README stating so/asking for new maintainers.

ErikBjare commented 2 years ago

Alright, this has been driving me crazy.

Played around with it, and the issue disappeared when I added use of the template syntax.

Example that didn't work:

---
layout: default
title: Test
permalink: /test/
---

h1 Test

What did work:

---
layout: default
title: Test
permalink: /test/
---

h1 Test {{ site.data.downloads.version }}

So now I'm basically adding some worthless template stuff to each page that doesn't have any, just to get it to not render plaintext.

DougBeney commented 2 years ago

Fascinating. Well, 4 years later I randomly have the urge to fix this.

Also, Thank you @ErikBjare! Very proud to have a project of mine utilized in ActivityWatch. Big fan of your project.

Very good find with Pug file only rendering when Liquid is used. I can confirm that.

This plugin basically works by hooking into Jekyll's Liquid renderer. Jekyll must have made a performance improvement by skipping Liquid rendering if no Liquid syntax is used.

I am going to try to fix this today.

DougBeney commented 2 years ago

Hi, all!

I just pushed a fix. jekyll-pug v1.6.0

The fix works perfectly, however it is not the sexiest solution. There's a function Jekyll uses to check if Liquid should be rendered. I overrided it to render liquid on all Pug files.

So everything will work just as it did before Jekyll made that performance improvement.

However, it would be nice if Pug files that do not have Liquid only render Pug and don't have to pass through the Liquid renderer.

So, I might take a crack at solving that later. But for now, it works. Enjoy!

ErikBjare commented 2 years ago

Thanks @DougBeney! I appreciate the fix and kind words ❤️