https://github.com/allejo/pure-liquid-utils
https://github.com/allejo/pure-liquid-utils
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/allejo/pure-liquid-utils
- Owner: allejo
- Created: 2023-06-19T21:46:25.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-19T22:54:52.000Z (almost 2 years ago)
- Last Synced: 2025-01-15T03:04:38.225Z (5 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pure Liquid Utilities
Pure Liquid Utilities (PLUtils) is a repo where I can store shared utilities between my [Pure Liquid projects](http://pure-liquid.allejo.org).
## `pltest.py`
A Python 3 script used for checking Jekyll assertions; ensuring that the expected HTML is generated from given Liquid. In a Liquid project, set up a collection so that you can create different items in that collection that each will render different behaviors of your Liquid snippet.
```yaml
# _config.ymltheme: null
collections:
tests:
output: truedefaults:
- scope:
path: ""
type: tests
values:
layout: null
permalink: /tests/:name
```Each item in the test collection should have two sections separated by the `` directive. The top section will be the Liquid you need to write and the bottom section contains the HTML that is expected to be generated. Use the Front Matter section to write any notes for that test; e.g. what issue are you adding this unit test because of.
```html
---
# See: https://github.com/allejo/jekyll-anchor-headings/issues/38
---{% capture text %}
Hello world
Greetings world
Sup world
Yo world
{% endcapture %}{% include anchor_headings.html html=text generateId=true %}
```> **Warning**
>
> The expected output (the bottom section), can only contain **ONE** HTML element. If you need to have multiple HTML elements, wrap everything with a `` (this is very React-esque).