Siteleaf

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

Site title

The title of your website.

site.domain

Site domain

Your website’s domain name (ie. barlawrence.com).

site.permalink

Site permalink

Your website’s full address (ie. http://barlawrence.com).

site.pages

Site pages

A nested array of pages.

site.posts

Site posts

Array of all posts in all pages.

site.feed_url

Site RSS feed

URL to your website’s RSS feed (ie. http://barlawrence.com/feed.xml).

site.sitemap_url

Site sitemap URL

URL to your website’s Sitemap file (ie. http://barlawrence.com/sitemap.xml).

site.date

Site publish date

Date of most recent publish.

Content Variables

type

Type

Can be page, post, archive, taxonomy, or tag.

title

Title

Title of content

url

URL

URL to object without domain (e.g. /blog/my-post)

permalink

Permalink

Full URL to object with domain (e.g. http://mysite.com/blog/my-post).

body

Body

Body in HTML (rendered form Markdown), available in page and post types).

body_raw

Raw body

Body in raw Markdown, available in page and post types.

excerpt

Excerpt

Shorened version of the body (use 2 empty lines to break), available in page and post types.

excerpt_raw

Raw excerpt

Excerpt in raw Markdwown, available in page and post types.

assets

Assets

Array of assets, available on page and post types.

meta

Meta

Array of metadata, available on page and post types.

taxonomy

Taxonomy

Array of taxonomy, available on post type only

tags

Tags

Array of tags available on taxonomy type only.

pages

Pages

Array of child-pages, available on page type only.

posts

Posts

Array of posts, available in page, archive, and tag types.

previous

Previous

The previous page or post, available in page or post types.

next

Next

The next page or post available in page or post types.

current

Current

Alias of the current page or post, available in page or post types.

parent

Parent

Parent page object (if exists)

archive_url

URL archive

URL to archive page, available in page type only.

date

Date

Date of publish, available in page and post types.

updated_at

Last updated

Date of last update.

author.fullname

Author full name

Full name of author, available in page or post types.

author.firstname

Author first name

First name of the author, available in page or post types.

author.lastname

Author last name

Last name of author, available in page or post types.

author.email

Author's email

Author's email, available in page and post types.

author.avatar

Author's avatar

Author's Gravatar URL, available in page and post types.

home?

Home

Boolean if page is homepage, available in page type only.

Asset Variables

type

Type

Can be image, audio, video, or other.

filename

Filename

Name of file (e.g. photo.jpg).

url

URL

URL to object without domain (e.g. /assets/photo.jpg).

permalink

Permalink

FUll URL to object with domain (e.g. http://mysite.com/assets/photo.jpg).

content_type

Content type

MIME type of asset (e.g. image/jpeg).

filesize

File size

Size of file in bytes (e.g. 1024)

date

Date

Date asset was created

meta

Meta

Array of all metadata key/value

meta.KEY

Meta by key

Get single metadata by key (e.g. Color).

key

Key

Name of metadata key (e.g. Color).

value

Value

Value of metadata (e.g. Red).

Taxonomy

taxonomy

Taxonomy

Array of all taxonomy sets.

taxonomy.KEY

Taxonomy key

Get tags by set name (e.g. Tags).

key

Key

Name of taxonomy set (e.g. Tags).

slug

Slug

URI slug for set (e.g. tags).

url

URL

URL for set page without domain (e.g. /blog/tags).

permalink

Permalink

URL for set page with domain (e.g. http://mysite.com/blog/tags).

tags

Tags

Array of tags in set.

tags.Key

Tags key

Get a single tag by name (e.g. Design).

Tags

value

Value

Name of tag

slug

Slug

URI slug for tag set (e.g. design).

url

URL

URL for tag page without domain (e.g. /blog/tags/design).

permalink

Permalink

URL for tag page with domain (e.g. http://mysite.com/blog/tags/design).

posts

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.

Notes