Skip to content

Instantly share code, notes, and snippets.

@jbrooksuk
Created January 5, 2013 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbrooksuk/4463064 to your computer and use it in GitHub Desktop.
Save jbrooksuk/4463064 to your computer and use it in GitHub Desktop.
Extends Octopress by taking post variables over site defaults.
{% if post.author %}
{% assign author = post.author %}
{% elsif page.author %}
{% assign author = page.author %}
{% else %}
{% assign author = site.author %}
{% endif %}
{% capture googleplus_user %}{% if site.googleplus_user %}{{ site.googleplus_user }}{% endif %}{% endcapture %}
<div class="postedby">
<h4><i class='icon-user'></i> Author:</h4>
<p class="author-name">
{% if post.author_site %}
<a href="{{post.author_site}}">{{ author }}</a>
{% else %}
<a href="https://plus.google.com/{{ googleplus_user }}?rel=author">{{ author }}</a>
{% endif %}
</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment