Fix tags in posts, and image sizing

This commit is contained in:
Lewis Dale 2023-12-30 16:36:45 +00:00
parent 4b52993d7b
commit c8c98c7ef9
3 changed files with 10 additions and 2 deletions

View File

@ -4,4 +4,10 @@ module.exports = (eleventyConfig) => {
return item.data.tags.includes(value); return item.data.tags.includes(value);
}) })
}); });
eleventyConfig.addFilter('except', (collection, value) => {
return collection.filter((item) => {
return item !== value;
})
});
} }

View File

@ -9,11 +9,12 @@ includePrism: true
<div class="e-content stack-md"> <div class="e-content stack-md">
{{ content | safe }} {{ content | safe }}
</div> </div>
{% if tags | length %} {% set filteredTags = tags | except("posts") %}
{% if filteredTags | length %}
<section> <section>
<h2>Tags:</h2> <h2>Tags:</h2>
<ul role="list"> <ul role="list">
{% for tag in tags %} {% for tag in filteredTags %}
<li><a class="p-category" href="/post/tag/{{ tag }}" rel="tag">#{{ tag }}</a></li> <li><a class="p-category" href="/post/tag/{{ tag }}" rel="tag">#{{ tag }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>

View File

@ -52,6 +52,7 @@ img,
picture { picture {
max-width: 100%; max-width: 100%;
display: block; display: block;
height: auto;
} }
/* Inherit fonts for inputs and buttons */ /* Inherit fonts for inputs and buttons */