github / pages-gem

A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
http://pages.github.com
MIT License
1.83k stars 356 forks source link

Please add Liquify plugin to Github Pages. #581

Open lukepighetti opened 6 years ago

lukepighetti commented 6 years ago

Liquify parses liquid contained in your markdown files.

<div class="content">
  {{ topic.content | markdownify | liquify}}
</div>

It is a very powerful way to generate static Jekyll sites, as you can use HTML + liquid for templating, Markdown for text, and your _config.yml file for global variables, and have them available for use in Markdown. This allows you to have key things like website links, download links, contained in one location and never repeated.

https://github.com/vividh/liquify

Cheers

MaxValue commented 6 years ago

Jekyll already uses "Liquid", see here. Maybe this is what you are searching for.

If you want to store data (like links or constants for example), you could use Data Files, which is already supported too.

If you want to recursively parse source files, you could use Includes.

It could also be that I understood the request wrongly. I just wanted to help you find a solution.

lukepighetti commented 6 years ago

Hi, thanks for the message.

Liquify is a Jekyll plugin that is not included with Github Pages that parses Liquid that is contained within Markdown. This is not possible with Github Pages currently as far as I know. This is outside the scope of Jekyll's built in Liquid parsing.

MaxValue commented 6 years ago

Oh! This is possible! I use it myself! This is actually the core feature of Jekyll.

For example this Markdown file (which uses Liquid logic and variables) gets interpreted by GitHub into this site.

arthurattwell commented 6 years ago

Luke may be referring to a couple of plugins that extend how Liquid is processed in Jekyll. For instance, by recursively processing Liquid tags (sometimes Liquid in the files included with Liquid isn't processed), or allowing Liquid in page frontmatter.

MaxValue commented 6 years ago

by recursively processing Liquid tags

I see. I thought so too in the beginning, that's why I mentioned Includes. They kinda allow embedding of Markdown file within Markdown file within Markdown file, but not recursively (I tried so myself, it just upsets the Liquid parser, recursion depth yaddayadda).

or allowing Liquid in page frontmatter

So basically templating the page front matter.

Ok now I think I have understood what this is about. Could be cool to have :)

You can probably achieve what you want by changing how your site is configured (e.g. using defaults and collections (with defaults)) which could be a workaround for the templated front matter.

Recursion sounds cool, but I guess we would need a good usage example to convince the GitHub guys to install this.

Another way to get this into GitHub Pages would be by simply asking the Liquid developers (or helping them) to implement similar features and then waiting for GitHub to update their Liquid version :P

lukepighetti commented 6 years ago

Yes, this is about putting liquid tags in the front-matter.

There is a list of plugins available to GitHub pages and they say to make a feature request if you want one added. This is a feature request for adding https://github.com/vividh/liquify to GitHub pages so that we can process liquid in our front matter.

Liquid team has no control over this.

char0n commented 3 years ago

Would be great to have it included in default plugins for gh-pages