Merge pull request #6846 from ashmaroli/variable-for-avatar

Assign and use Liquid variables in templates
This commit is contained in:
Frank Taillandier 2018-03-14 13:27:05 +01:00 committed by GitHub
commit 8caa101439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -13,10 +13,10 @@
<span class="post-date">
{{ post.date | date_to_string }}
</span>
<a href="https://github.com/{{ post.author }}" class="post-author">
{% assign author = post.author %}
<a href="https://github.com/{{ author }}" class="post-author">
{% avatar user=author size=24 %}
{{ post.author }}
{{ author }}
</a>
</div>
<div class="post-content">

View File

@ -19,9 +19,10 @@ layout: news
<span class="post-date">
{{ page.date | date_to_string }}
</span>
<a href="https://github.com/{{ page.author }}" class="post-author">
{% avatar {{ page.author}} size=24 %}
{{ page.author }}
{% assign author = page.author %}
<a href="https://github.com/{{ author }}" class="post-author">
{% avatar user=author size=24 %}
{{ author }}
</a>
</div>
<div class="post-content">