chore(samples): add liquid.liquid (#2599)

This commit is contained in:
Hammy 2024-11-08 18:56:03 +00:00 committed by GitHub
parent 95aae3360e
commit dd469d317f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

51
samples/liquid.liquid Normal file
View file

@ -0,0 +1,51 @@
<article>
<header>
<h1>{{ article.title }}</h1>
{%- if section.settings.blog_show_author -%}
<span> By {{ article.author }} </span>
{%- endif -%}
{%- if section.settings.blog_show_date -%}
<span>
{{ article.published_at | time_tag: format: 'month_day_year' }}
</span>
{%- endif -%}
</header>
{{ article.content }}
{%- if article.tags.size > 0 -%}
<footer>
<ul aria-label="Tags">
{%- for tag in article.tags -%}
<li>
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">
{{ tag }}
</a>
</li>
{%- endfor -%}
</ul>
</footer>
{%- endif -%}
</article>
{% schema %}
{
"name": "Posts",
"settings": [
{
"type": "checkbox",
"id": "blog_show_author",
"label": "Show author",
"default": true
},
{
"type": "checkbox",
"id": "blog_show_date",
"label": "Show date",
"default": true
}
]
}
{% endschema %}