Skip to content

Instantly share code, notes, and snippets.

View Joozo's full-sized avatar

joozo Joozo

View GitHub Profile
@Joozo
Joozo / dabblet.css
Created January 14, 2015 02:38
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(90deg, #f06, yellow);
min-height: 100%;
@Joozo
Joozo / 01-before.html
Created November 27, 2015 01:52 — forked from mikeygee/01-before.html
truncate blog posts in jekyll
<!-- using the truncate filter -->
{% for post in site.posts limit:10 %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span>
{% if post.content.size > 2000 %}
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node -->
<a href="{{ post.url }}">read more</a>
{% else %}
{{ post.content }}
{% endif %}