garagehq.deuxfleurs.fr/templates/macros.html
2022-01-24 18:36:50 +01:00

79 lines
3.7 KiB
HTML
Executable file

{% macro social_links(social_config) %}
<p class="flex items-center justify-center space-x-2">
{% if social_config.git %}
<a href="{{ social_config.git }}" target="_blank">
<span class="icon is-large" title="Git">
<i class="fab fa-git fa-lg text-garage-gray h-8 w-8 bg-white hover:bg-garage-orange hover:text-white rounded-full shadow flex items-center justify-center"></i>
</span>
</a>
{% endif %}
{% if social_config.email %}
<a href="mailto:{{ social_config.email }}" target="_blank">
<span class="icon is-large" title="Email">
<i class="far fa-envelope fa-lg text-garage-gray h-8 w-8 bg-white hover:bg-garage-orange hover:text-white rounded-full shadow flex items-center justify-center"></i>
</span>
</a>
{% endif %}
{% if config.generate_feed %}
<a href="{{ config.base_url }}/{{ config.feed_filename }}" target="_blank">
<span class="icon is-large" title="RSS Feed">
<i class="fas fa-rss fa-lg text-garage-gray h-8 w-8 bg-white hover:bg-garage-orange hover:text-white rounded-full shadow flex items-center justify-center"></i>
</span>
</a>
{% endif %}
</p>
{% endmacro %}
{% macro page_publish_metadata(page) %}
<span class="icon-text has-text-grey">
<span>Published on</span>
<div class="font-semibold inline-flex items-center justify-center space-x-1 bg-garage-gray bg-opacity-10 p-0.5 rounded">
<span><time datetime="{{ page.date }}">{{ page.date | date(format='%B %d, %Y') }}</time></span>
</div>
</span>
{% endmacro %}
{% macro page_content_metadata(page) %}
<span class="icon-text has-text-grey">
<span class="inline-flex items-center justify-center space-x-1 bg-garage-gray bg-opacity-10 p-0.5 rounded">
{{ page.reading_time }} min reading time
</span>
<span class="inline-flex items-center justify-center space-x-1 bg-garage-gray bg-opacity-10 p-0.5 rounded">
{{ page.word_count }} words
</span>
</span>
{% endmacro %}
{% macro render_categories(categories) %}
<div class="flex items-center">
<span class="text-sm">Categories</span>
{% for category in categories %}
<a class="font-semibold inline-flex items-center justify-center space-x-1 px-1 py-0.5 rounded" href="{{ get_taxonomy_url(kind='categories', name=category) }}">
<div class="text-garage-gray inline-flex items-center space-x-1 border px-1 border-gray-300 hover:border-garage-orange rounded">
<span class="icon">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path></svg>
</span>
<span>{{category}}</span>
</div>
</a>
{% endfor %}
</div>
{% endmacro %}
{% macro render_tags(tags) %}
<div class="flex items-center">
<span class="text-sm">Tags</span>
{% for tag in tags %}
<a class="font-semibold inline-flex items-center justify-center space-x-1 px-1 py-0.5 rounded" href="{{ get_taxonomy_url(kind='tags', name=tag) }}">
<div class="text-garage-gray inline-flex items-center space-x-1 border px-1 border-gray-300 hover:border-garage-orange rounded">
<span class="icon">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path></svg>
</span>
<span>{{tag}}</span>
</div>
</a>
{% endfor %}
</div>
{% endmacro %}