Skip to content

Instantly share code, notes, and snippets.

View sskylar's full-sized avatar
lgtm

Skylar SC sskylar

lgtm
View GitHub Profile
@sskylar
sskylar / harmony.export.tpl
Last active December 30, 2015 01:59
WXR dump for Harmony CMS
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dsq="http://www.disqus.com/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.0/"
>
<channel>
<title>{{ blog.title }}</title>
<link>{{ blog.url }}</link>
@sskylar
sskylar / page-feed.xml.liquid
Created December 9, 2013 23:24
Page-specific RSS feeds in Siteleaf (replace `blog` with the slug of your page).
{% assign page = site.pages.blog %}
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>{{site.title | xml_escape}}: {{page.title | xml_escape}}</title>
<link>{{page.permalink}}</link>
<pubDate>{{site.date | date_to_rfc822}}</pubDate>
{% for post in page.posts limit:20 %}
<item>
<title>{{post.title | xml_escape}}</title>
@sskylar
sskylar / default.html
Last active October 21, 2017 05:31
Front end site translations with Siteleaf v2 (http://www.siteleaf.com) and jquery.localize.js (https://github.com/coderifous/jquery-localize).
<html>
<body>
<h1 data-localize="{{page.id}}.title">{{page.title}}</h1>
<div data-localize="{{page.id}}.body">
{{content}}
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
@sskylar
sskylar / related_posts.html
Created February 4, 2014 22:47
Related posts in Siteleaf (http://siteleaf.com), shows up to 3 related posts based on tags of current post.
@sskylar
sskylar / widow-fix.html
Created February 25, 2014 18:31
Avoid widows using Siteleaf/Liquid
{% assign words = title | split:' ' %}
{% for word in words %}{% if forloop.last %}&nbsp;{% elsif forloop.index > 1 %} {% endif %}{{word}}{% endfor %}
@sskylar
sskylar / sorted-posts.html
Created May 16, 2014 17:15
Sort posts by title using Liquid in Siteleaf
{% assign sorted_posts = posts.all | sort:'title' %}
{% for post in sorted_posts %}
<li>{{ post.title }}</li>
{% endfor %}
@sskylar
sskylar / posts-by-tag.html
Created June 9, 2014 16:57
Group posts by tag and sort alphabetically in Siteleaf
{% for tag in taxonomy['tags'] %}
<h1>{{tag}}</h1>
<ul>
{% assign sorted_posts = tag.posts.all | sort:'title' %}
{% for post in sorted_posts %}
<li>{{post.title}}</li>
{% endfor %}
</ul>
{% endfor %}
@sskylar
sskylar / featured.html
Created June 27, 2014 05:33
Group a limited number of featured posts in Siteleaf using Liquid.
@sskylar
sskylar / dropdown-nav.html
Last active July 10, 2018 21:17
Drop-down nav for Siteleaf v1 using Liquid
{% for page in site.pages %}
<li {% if page.pages.size > 1 %}class="has-dropdown"{% endif %}>
<a href="{{page.url}}"{% if page.url == url %} class="active"{% endif %}>{{page.title}}</a>
{% if page.pages.size > 1 %}
<ul class="dropdown">
{% for subpage in page.pages %}
<li><a href="{{subpage.url}}"{% if subpage.url == url %} class="active"{% endif %}>{{subpage.title}}</a></li>
{% endfor %}
</ul>
{% endif %}
@sskylar
sskylar / related.json.liquid
Created July 3, 2014 16:09
Dynamic related posts in Siteleaf using JSON