feat: update catalogue templates

This commit is contained in:
Devin Haska 2024-02-18 12:42:25 -08:00
parent 86f0122fd9
commit 55982e5bf5
6 changed files with 38 additions and 21 deletions

View file

@ -8,7 +8,10 @@ layout: base
datetime="{{ date }}"> datetime="{{ date }}">
{% include "svgs/calendar.svg" %} {% include "svgs/calendar.svg" %}
{{ date | formatDate("MMMM Do YYYY") }}</time> {{ date | formatDate("MMMM Do YYYY") }}</time>
<section class="[ meta ] [ flex justify-between mb-1 gap-1 ]"> <section class="[ catalogue-meta ] [ gap-1 mb-1 ]">
{% if image %}
{% image image, "", "" %}
{% endif %}
<div> <div>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
{% if subtitle %}<h3 class="[ text-fadeText my-0.5 ]">{{ subtitle }}</h3>{% endif %} {% if subtitle %}<h3 class="[ text-fadeText my-0.5 ]">{{ subtitle }}</h3>{% endif %}
@ -19,9 +22,6 @@ layout: base
</ul> </ul>
{% endif %} {% endif %}
</div> </div>
{% if image %}
<div>{% image image, "", "" %}</div>
{% endif %}
</section> </section>
{{ content | safe }} {{ content | safe }}
</article> </article>

View file

@ -3,14 +3,14 @@ layout: base
--- ---
<article class="[ catalogue ] [ flow ]"> <article class="[ catalogue ] [ flow ]">
<section class="[ meta ] [ flex justify-between mb-1 ]"> <section class="[ catalogue-meta ] [ gap-1 mb-1 ]">
{% if image %}
{% image image, "", "" %}
{% endif %}
<div> <div>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<h2 class="[ text-fadeText ]">{{ subtitle }}</h2> <h2 class="[ text-fadeText ]">{{ subtitle }}</h2>
</div> </div>
{% if image %}
<div>{% image image, "", "" %}</div>
{% endif %}
</section> </section>
{{ content | safe }} {{ content | safe }}
</article> </article>

View file

@ -8,7 +8,7 @@ layout: base
datetime="{{ date }}"> datetime="{{ date }}">
{% include "svgs/calendar.svg" %} {% include "svgs/calendar.svg" %}
{{ date | formatDate("MMMM Do YYYY") }}</time> {{ date | formatDate("MMMM Do YYYY") }}</time>
<section class="[ meta ] [ mb-1 ]"> <section class="[ catalogue-meta ] [ gap-1 mb-1 ]">
{% if image %} {% if image %}
{% image image, "", "" %} {% image image, "", "" %}
{% endif %} {% endif %}
@ -16,7 +16,7 @@ layout: base
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<h2 class="[ text-fadeText my-0.5 ]">{{ year }}</h2> <h2 class="[ text-fadeText my-0.5 ]">{{ year }}</h2>
{% if filteredTags | length > 0 %} {% if filteredTags | length > 0 %}
<ul class="[ flex list-none p-0 gap-0.5 ]"> <ul class="[ flex list-none p-0 gap-0.5 mb-0 ]">
{% for tag in filteredTags %}<li class="[ bg-surface radius-1 px-1 py-0.5 ]">{{ tag }}</li>{% endfor %} {% for tag in filteredTags %}<li class="[ bg-surface radius-1 px-1 py-0.5 ]">{{ tag }}</li>{% endfor %}
</ul> </ul>
{% endif %} {% endif %}

View file

@ -1,5 +1,5 @@
.catalogue .meta picture { .catalogue {
inline-size: 10rem; container-type: inline-size;
} }
.catalogue-type { .catalogue-type {
@ -9,6 +9,23 @@
.catalogue-meta { .catalogue-meta {
display: grid; display: grid;
grid-template-columns: auto 1fr; grid-template-columns: 1fr 200px;
font-size: 0.875rem; }
.catalogue-meta picture {
max-width: 200px;
}
.catalogue-meta > *:first-child {
order: 1;
}
@container (max-width: 32rem) {
.catalogue-meta {
grid-template-columns: 1fr;
}
.catalogue-meta > *:first-child {
order: initial;
}
} }

View file

@ -1,8 +1,8 @@
/* /*
FLOW UTILITY * FLOW UTILITY
Like the Every Layout stack: https://every-layout.dev/layouts/stack/ * Like the Every Layout stack: https://every-layout.dev/layouts/stack/
Info about this implementation: https://piccalil.li/quick-tip/flow-utility/ * Info about this implementation: https://piccalil.li/quick-tip/flow-utility/
*/ */
.flow > * + * { .flow > * + * {
margin-block-start: var(--flow-space, 1em); margin-block-start: var(--flow-space, 1em);
} }

View file

@ -1,7 +1,7 @@
/* /*
VISUALLY HIDDEN UTILITY * VISUALLY HIDDEN UTILITY
Info: https://piccalil.li/quick-tip/visually-hidden/ * Info: https://piccalil.li/quick-tip/visually-hidden/
*/ */
.visually-hidden { .visually-hidden {
border: 0; border: 0;
clip: rect(0 0 0 0); clip: rect(0 0 0 0);