Skip to content

Instantly share code, notes, and snippets.

@artlung
Created April 18, 2025 15:27
Show Gist options
  • Save artlung/81d3c9ecac483bcee435b9f77114630f to your computer and use it in GitHub Desktop.
Save artlung/81d3c9ecac483bcee435b9f77114630f to your computer and use it in GitHub Desktop.
Likes Twig Templates by Joe Crawford (from https://artlung.com/likes/
<a href="https://artlung.com" class="p-author h-card">
Joe Crawford
<img src="https://artlung.com/blog/wp-content/uploads/2023/02/[email protected]"
class="u-photo" alt=""
style="display: none;"
/>
</a>
{% if author is not empty %}
<article class="h-entry">
{% include 'artlung_author_tag.html.twig' %} <span>liked:</span>
<span class="h-cite u-like-of">
<a class="u-url" href="{{ url }}">{{ title }}</a> by
<span class="p-author h-card">
{% if author.url is defined %}
<a class="u-url p-name" href="{{ author.url }}">{{ author.name }}</a>
{% else %}
<span class="p-name">{{ author.name }}</span>
{% endif %}
</span>
{% if excerpt %}
: <blockquote class="e-content">
{{ excerpt }}
</blockquote>
{% endif %}
{% if published_datetime is not empty %}
<small><time class="dt-published" datetime="{{ published_datetime }}">({{ published_datetime |date('j F Y') }})</time></small>
{% endif %}
</span>
</article>
{% else %}
<article class="h-entry">
{% include 'artlung_author_tag.html.twig' %}
<span class="p-summary">
<span>liked:</span>
<a class="u-like-of" href="{{ url }}">{{ title }}</a>
{% if published_datetime is defined %}
<small><time class="dt-published" datetime="{{ published_datetime }}">({{ published_datetime |date('j F Y') }})</time></small>
{% endif %}
</span>
</article>
{% endif %}
{% if author is not empty %}
Joe Crawford liked:
<a href="{{ url }}">{{ title }}</a> by
{% if author.url is defined %}
<a href="{{ author.url }}">{{ author.name }}</a>
{% else %}
{{ author.name }}
{% endif %}
{% if excerpt %}
: <blockquote class="e-content">
{{ excerpt }}
</blockquote>
{% endif %}
{% else %}
Joe Crawford liked:
<a href="{{ url }}">{{ title }}</a>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment