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 / siteleaf-wget.sh
Created August 23, 2016 19:07
Download a file from Siteleaf v2 API using wget
wget -O Gemfile https://api.siteleaf.com/v2/sites/SITE_ID/source/Gemfile?download \
--auth-no-challenge --user=API_KEY --password=API_SECRET
@sskylar
sskylar / 2016-07-18-example.markdown
Created July 18, 2016 16:02
Related posts in Siteleaf v2/Jekyll using slugs as reference
title related_posts
foo
hello-world
foo

Blog post here.

@sskylar
sskylar / _config.yml
Last active June 20, 2018 14:55
Use a custom permalink for uploads in Siteleaf v2
---
collections:
uploads:
title: Uploads
output: true
permalink: "/images/:path" # replace "images" with the name of your choice
@sskylar
sskylar / archive.html
Created May 25, 2016 16:24
Archive page in Siteleaf v1
<ul>
{% assign years = site.posts | group_by: 'year' %}
{% for year in years %}
{% assign months = year.items | group_by: 'month' %}
{% for month in months %}
<li>
<h3>{{month.items.first.date | date:'%B %Y'}}</h3>
<ul>
{% for post in month.items %}
<li><time datetime="{{post.date | date_to_xmlschema}}">{{post.date | date:'%d'}}</time> <a href="{{post.url}}">{{post.title}}</a></li>
@sskylar
sskylar / committer.sh
Created April 14, 2016 18:19
Check Git for commits by Siteleaf using bash
LAST_COMMIT_EMAIL=`git log --pretty=format:"%ce" -1`
SITE_LEAF_EMAIL="[email protected]"
# Determine whether or not to run the deployment
if ["${LAST_COMMIT_EMAIL}" == "${SITE_LEAF_EMAIL}"]
then
echo "Commit is from Siteleaf, do nothing"
else
echo "Commit is *NOT* from Siteleaf Deploying..."
# execute a deployment script here
@sskylar
sskylar / _config.yml
Created February 22, 2016 22:26
Using Kramdown in Siteleaf
markdown: kramdown
@sskylar
sskylar / _config.yml
Created February 22, 2016 17:06
Suggested markdown settings for Siteleaf v2
markdown: redcarpet
redcarpet:
extensions:
- autolink
- fenced_code_blocks
- lax_spacing
- strikethrough
- superscript
- tables
- footnotes
@sskylar
sskylar / index.html
Last active January 22, 2016 16:11
Siteleaf v1 highlighted menu using tags and CSS
<html>
<body class="{{type}} {{slug}} {% for tag in taxonomy.tags %} {{tag.slug}} {% endfor %}>
<nav>
<a href="/blog" class="blog">Blog</a>
<a href="/blog/tags/apple" class="apple">Apple</a>
</nav>
</body>
</html>
@sskylar
sskylar / sitemap.xml
Created January 22, 2016 04:43
Jekyll sitemap
---
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% capture site_url %}{% if site.url %}{{ site.url | append: site.baseurl }}{% else %}{{ site.github.url }}{% endif %}{% endcapture %}
{% for page in site.html_pages %}{% unless page.sitemap == false %}
<url>
<loc>{{ page.url | replace:'/index.html','/' | prepend: site_url }}</loc>
{% if page.last_modified_at %}
<lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
@sskylar
sskylar / _config.yml
Created January 21, 2016 16:44
Custom menus in Jekyll
header_menu:
About: "/about"
Departments: "/departments"
Contact: "/people"