A Dash cheat sheet for Siteleaf. Manage your content online with Siteleaf, then publish static files to host anywhere you want. It's like having a web-based backend for Jekyll that your clients can actually use.
Site Variables
|
Site title The title of your website. |
|
Site domain Your website’s domain name (ie. barlawrence.com). |
|
Site permalink Your website’s full address (ie. http://barlawrence.com). |
|
Site pages A nested array of pages. |
|
Site posts Array of all posts in all pages. |
|
Site RSS feed URL to your website’s RSS feed (ie. http://barlawrence.com/feed.xml). |
|
Site sitemap URL URL to your website’s Sitemap file (ie. http://barlawrence.com/sitemap.xml). |
|
Site publish date Date of most recent publish. |
Content Variables
|
Type Can be |
|
Title Title of content |
|
URL URL to object without domain (e.g. |
|
Permalink Full URL to object with domain (e.g. |
|
Body Body in HTML (rendered form Markdown), available in |
|
Raw body Body in raw Markdown, available in |
|
Excerpt Shorened version of the body (use 2 empty lines to break), available in |
|
Raw excerpt Excerpt in raw Markdwown, available in |
|
Assets Array of assets, available on |
|
Meta Array of metadata, available on |
|
Taxonomy Array of taxonomy, available on |
|
Tags Array of tags available on |
|
Pages Array of child-pages, available on |
|
Posts Array of posts, available in |
|
Previous The previous |
|
Next The next |
|
Current Alias of the current |
|
Parent Parent page object (if exists) |
|
URL archive URL to archive page, available in |
|
Date Date of publish, available in |
|
Last updated Date of last update. |
|
Author full name Full name of author, available in |
|
Author first name First name of the author, available in |
|
Author last name Last name of author, available in |
|
Author's email Author's email, available in |
|
Author's avatar Author's Gravatar URL, available in |
|
Home Boolean if page is homepage, available in |
Asset Variables
|
Type Can be |
|
Filename Name of file (e.g. |
|
URL URL to object without domain (e.g. |
|
Permalink FUll URL to object with domain (e.g. |
|
Content type MIME type of asset (e.g. |
|
File size Size of file in bytes (e.g. |
|
Date Date asset was created |
|
Meta Array of all metadata key/value |
|
Meta by key Get single metadata by key (e.g. |
|
Key Name of metadata key (e.g. |
|
Value Value of metadata (e.g. |
Taxonomy
|
Taxonomy Array of all taxonomy sets. |
|
Taxonomy key Get tags by set name (e.g. |
|
Key Name of taxonomy set (e.g. |
|
Slug URI slug for set (e.g. |
|
URL URL for set page without domain (e.g. |
|
Permalink URL for set page with domain (e.g. |
|
Tags Array of tags in set. |
|
Tags key Get a single tag by name (e.g. |
Tags
|
Value Name of tag |
|
Slug URI slug for tag set (e.g. |
|
URL URL for tag page without domain (e.g. |
|
Permalink URL for tag page with domain (e.g. |
|
Posts Array of posts with this tag. |
Code Samples
Basic output <h2>{{title}}</h2> {{body}} Get the title and body for the current page. |
|
Loop {% for post in posts limit:20 %} <article> <header><a href="{{post.url}}">{{post.title}}</a></header> {{post.body}} <footer>Posted on {{post.date | date: "%b %d, %Y"}} by {{post.author.fullname}}</footer> </article> {% endfor %} Loop through the first 20 posts on the current page. |
|
Asset loop {% for asset in assets %} {% if asset.type == 'image' %} <img src="{{asset.url}}"> {% elsif asset.type == 'audio' %} <audio><source src="{{asset.url}}" type="{{asset.content_type}}"></audio> {% elsif asset.type == 'video' %} <video><source src="{{asset.url}}" type="{{asset.content_type}}"></video> {% elsif asset.type == 'other' %} <a href="{{asset.url}}">Download {{asset.filename}}</a></li> {% endif %} {% endfor %} Loop through assets. |
|
Navigation menu <nav> <ul> {% for page in site.pages %} <li><a href="{{page.url}}"{% if page.url == url %} class="selected"{% endif %}>{{page.title}}</a></li> {% endfor %} </ul> </nav> Loop through site.pages to build a navigation menu |
Notes
- Full Siteleaf theme documentation can be found here.