Skip to content

Instantly share code, notes, and snippets.

@poritsky
Forked from connor/jonathan.html
Created January 9, 2012 23:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save poritsky/8dbe389dfe650042f8bd to your computer and use it in GitHub Desktop.
Save poritsky/8dbe389dfe650042f8bd to your computer and use it in GitHub Desktop.
help with the article.html file
{% if index %}
<div class="entry-content">{{ content | excerpt }}</div>
{% capture excerpted %}{{ content | has_excerpt }}{% endcapture %}
{% if excerpted == 'true' %}
<footer>
<a rel="full-article" href="{{ root_url }}{{ post.url }}">{{ site.excerpt_link }}</a>
</footer>
{% endif %}
{% if post.external-url %}
<div class="entry-content"><a href="{{ root_url }}{{ post.url }}">Permalink</a><!-- add permalink at end of link posts; could be text or glyph -->
</div>
{% endif %}
{% else %}
<div class="entry-content">{{ content }}</div>
{% endif %}
{% if post.external-url %} <!-- this block gets run if the external-url attribute is present -->
<h1 class="entry-title external">
<a href="{{ post.external-url }}"> <!-- NOTE: see that the href is to the post's external-url attribute? that's what's needed for the links to work. -->
<!-- on my site, I include "[link]" here -->
{% if site.titlecase %}
{{ post.title | titlecase }}
{% else %}
{{ post.title }}
{% endif %}
</a>
</h1>
{% else %} <!-- if the external-url attribute is not present, this code gets run -->
<h1 class="entry-title">
<a href="{{ root_url }}{{ post.url }}">
{% if site.titlecase %}
{{ post.title | titlecase }}
{% else %}
{{ post.title }}
{% endif %}
</a>
</h1>
{% endif %}
@poritsky
Copy link
Author

poritsky commented Jan 9, 2012

Put an addition on the end of article.html to include permalink on link posts.

@whlteXbread
Copy link

Thanks for putting this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment