feat: rename includes and data directories
This commit is contained in:
parent
864bc7be71
commit
408e859ef4
41 changed files with 7 additions and 9 deletions
6
src/includes/macros/date.njk
Normal file
6
src/includes/macros/date.njk
Normal file
|
@ -0,0 +1,6 @@
|
|||
{% macro format(dateString) %}
|
||||
<time class="date flex items-center gap-0.5 text-fadeText"
|
||||
datetime="{{ dateString }}">
|
||||
<span class="text-primary line-height-s">{% include "svgs/calendar.svg" %}</span>{{ dateString | formatDate("MMMM Do YYYY") }}
|
||||
</time>
|
||||
{% endmacro %}
|
14
src/includes/macros/media-grid.njk
Normal file
14
src/includes/macros/media-grid.njk
Normal file
|
@ -0,0 +1,14 @@
|
|||
{% macro grid(data, shape = "vertical") %}
|
||||
<ul class="media-grid {{ shape }} list-none p-0">
|
||||
{% for item in data %}
|
||||
<li class="radius-0.5">
|
||||
<a href="{{ item.url }}">
|
||||
{% if item.data.image %}<img src="{{ item.data.image }}" alt="" />{% endif %}
|
||||
<div class="meta font-size-s line-height-s flex items-end px-0.5 pb-0.5">
|
||||
<span class="meta-text">{{ item.data.title }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endmacro %}
|
21
src/includes/macros/posts.njk
Normal file
21
src/includes/macros/posts.njk
Normal file
|
@ -0,0 +1,21 @@
|
|||
{% macro one(post, fmt = "MM/DD") %}
|
||||
<article class="posts-list-item column-gap-0.5 justify-between line-height-l">
|
||||
<a href="{{ post.url }}">{{ post.data.title }}</a>
|
||||
<time datetime="{{ post.date }}" class="text-fadeText">{{ post.date | formatDate(fmt) }}</time>
|
||||
<p class="text-fadeText font-size-s line-height-m">{{ post.data.excerpt }}</p>
|
||||
</article>
|
||||
{% endmacro %}
|
||||
{% macro list(posts, format = "MM/DD") %}
|
||||
<ol class="flow p-0" role="list">
|
||||
{% for post in posts %}<li class="flow-space-0.5">{{ one(post, format) }}</li>{% endfor %}
|
||||
</ol>
|
||||
{% endmacro %}
|
||||
{% macro yearList(posts, year, format = "MM/DD") %}
|
||||
<section class="flow">
|
||||
<header class="cluster gap-0.5">
|
||||
<h2>{{ year }}</h2>
|
||||
<p class="pill">{{ posts | length }}</p>
|
||||
</header>
|
||||
{{ list(posts, format) }}
|
||||
</section>
|
||||
{% endmacro %}
|
11
src/includes/macros/tags.njk
Normal file
11
src/includes/macros/tags.njk
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% macro tagList(tags, urlPrefix) %}
|
||||
<ul class="categories cluster list-none p-0 line-height-m">
|
||||
{% for tag in tags %}
|
||||
<li>
|
||||
<a class="button" href="{{ urlPrefix }}/tag/{{ tag | slugify }}">
|
||||
{% include "svgs/frame.svg" %}
|
||||
{{ tag }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endmacro %}
|
13
src/includes/macros/utils.njk
Normal file
13
src/includes/macros/utils.njk
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% macro stars(number) %}
|
||||
{% set filledStars = number %}
|
||||
{% set emptyStars = 5 - number %}
|
||||
<ul class="stars flex list-none p-0 mb-0 text-primary"
|
||||
aria-description="{{ number }} out of 5 stars">
|
||||
{% for i in range(0, filledStars) %}
|
||||
<li class="star-filled">{% include "svgs/star.svg" %}</li>
|
||||
{% endfor %}
|
||||
{% for i in range(0, emptyStars) %}
|
||||
<li class="star-empty">{% include "svgs/star-empty.svg" %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endmacro %}
|
Loading…
Add table
Add a link
Reference in a new issue