Skip to content

Instantly share code, notes, and snippets.

@komiya-atsushi
Created October 13, 2013 14:07
Show Gist options
  • Save komiya-atsushi/6962754 to your computer and use it in GitHub Desktop.
Save komiya-atsushi/6962754 to your computer and use it in GitHub Desktop.
Octopress の個々のエントリに Google+ アカウントを著者情報としてリンクさせたい場合の _includes/post/author.html の記述。
{% if post.author %}
{% assign author = post.author %}
{% elsif page.author %}
{% assign author = page.author %}
{% else %}
{% assign author = site.author %}
{% endif %}
{% if post.googleplus_user %}
{% assign googleplus_user = post.googleplus_user %}
{% elsif page.googleplus_user %}
{% assign googleplus_user = page.googleplus_user %}
{% else %}
{% assign googleplus_user = site.googleplus_user %}
{% endif %}
{% if author %}
<span class="byline author vcard">Posted by
<span class="fn">
{% if googleplus_user %}
<a href="https://plus.google.com/{{ googleplus_user }}?rel=author">{{ author }}</a>
{% else %}
{{ author }}
{% endif %}
</span>
</span>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment