Skip to content

Instantly share code, notes, and snippets.

View nerdburn's full-sized avatar

Shawn Adrian nerdburn

View GitHub Profile
{% if posts %}
{% for post in posts %}
<div class="post">
<h2><a href="{{ post.permalink }}">{{ post.title }}</a></h2>
<p>Posted on {{ post.created_at|format_date }}</p>
{% if post.content|striptags|wordcount > 0 %}
<p>{{ post.content|striptags|truncate(200) }}</p>
{% endif %}
</div>
{% endfor %}
{% if posts %}
{% for post in posts %}
<div class="post">
<h2><a href="{{ post.permalink }}">{{ post.title }}</a></h2>
<p class="muted">Posted on {{ post.created_at }}</p>
{{ post.content }}
</div>
{% endfor %}
{% else %}
<p>Oh noes! There are no posts here :(</p>
{% if posts %}
<p>Yay, there are posts! :)</p>
{% else %}
<p>Oh noes! There are no posts here :(</p>
{% endif %}
@nerdburn
nerdburn / gist:3acbdd4fbe5d9074ad5d
Created October 22, 2014 20:37
Conditional Logic Block
{% if post.type == 'link' %}
<p><a href="{{ post.url }}"><i class="icon-share"></i> {{ post.url }}</a></p>
{% endif %}
<h2>{{ post.title }}</h2>
<p>{{ post.created_at|format_date }}</p>
<div class="content">
{{ post.content }}
</div>
[twitter url="https://twitter.com/postachio/status/423256736254808064"]
[soundcloud url="https://soundcloud.com/steelvibrations/progress-1"]
[gist url="https://gist.github.com/nerdburn/2ee8e956a5fdc5c2ddbe"]
@nerdburn
nerdburn / gist:2ee8e956a5fdc5c2ddbe
Created June 24, 2014 17:03
Code Embed Example
<!DOCTYPE html>
<html>
<head>
<title>Yay!</title>
</head>
<body>
<p>Whee!</p>
</body>
</html>
[flickr url="http://www.flickr.com/photos/josh_hua_richardson/sets/72157633425874466/"]