Skip to content

Instantly share code, notes, and snippets.

@connor
Created January 9, 2012 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save connor/93d0193ed7bb0f8841b9 to your computer and use it in GitHub Desktop.
Save connor/93d0193ed7bb0f8841b9 to your computer and use it in GitHub Desktop.
help with the article.html file
{% 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 %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment