assign and use Liquid variables in templates

This commit is contained in:
Ashwin Maroli 2018-03-14 15:34:46 +05:30
parent 86d86258a8
commit b91ecf3c01
2 changed files with 7 additions and 6 deletions

View File

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

View File

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