📝 Edit on GitHub
Templating
Cheatsheet for using Liquid templating and plain HTML in Jekyll projects
Topics
Pages
Content
Comment
{% comment %}
Comment message
{% endcomment %}
Collections
Iterate over collection
_config.yml
collections: foo: output: true
_foo/bars/*.md
index.md
--- --- {% for item in site.foo.bars %} {{ item.title }} {% endfor %}
Filter assets
{% for asset in site.static_files %}
{% if asset.path contains '<NEEDLE>' %}
<a href="{{ asset.path | relative_url }}">{{ asset.path }}</a>
{% endif %}
{% endfor %}
Improve this page
Add a button for visitors to go to GitHub and edit the page.
Sample text:
- Improve this page
- Edit this page
- Edit on GitHub
- Edit this page on GitHub
For an icon, use one of:
- Unicode emoji, safe to use in HTML: 📝
- FontAwesome logo:
<i class="fa fa-pencil"></i>
Jekyll
<a href="https://github.com/MichaelCurrin/dev-cheatsheets/edit/master/{{ page.path }}">
Improve this page
</a>
See also the _includes
folder of this repo.
DocsifyJS
For DocsifyJS, use a plugin: