Switch to use 1.0+ slugify filter instead

This commit is contained in:
Zach Leatherman 2022-06-29 12:03:41 -05:00
parent 8cc9cb8996
commit 137e76fb42
5 changed files with 5 additions and 5 deletions

View File

@ -72,7 +72,7 @@ module.exports = function(eleventyConfig) {
symbol: "#"
}),
level: [1,2,3,4],
slugify: eleventyConfig.getFilter("slug")
slugify: eleventyConfig.getFilter("slugify")
});
eleventyConfig.setLibrary("md", markdownLibrary);

View File

@ -6,7 +6,7 @@ templateClass: tmpl-post
<time datetime="{{ page.date | htmlDateString }}">{{ page.date | readableDate }}</time>
{%- for tag in tags | filterTagList %}
{%- set tagUrl %}/tags/{{ tag | slug }}/{% endset %}
{%- set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<a href="{{ tagUrl | url }}" class="post-tag">{{ tag }}</a>
{%- endfor %}

View File

@ -4,7 +4,7 @@
<a href="{{ post.url | url }}" class="postlist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a>
<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate }}</time>
{% for tag in post.data.tags | filterTagList %}
{% set tagUrl %}/tags/{{ tag | slug }}/{% endset %}
{% set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<a href="{{ tagUrl | url }}" class="post-tag">{{ tag }}</a>
{% endfor %}
</li>

View File

@ -5,6 +5,6 @@ layout: layouts/home.njk
<h1>Tags</h1>
{% for tag in collections.tagList %}
{% set tagUrl %}/tags/{{ tag | slug }}/{% endset %}
{% set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<a href="{{ tagUrl | url }}" class="post-tag">{{ tag }}</a>
{% endfor %}

View File

@ -12,7 +12,7 @@ pagination:
layout: layouts/home.njk
eleventyComputed:
title: Tagged “{{ tag }}”
permalink: /tags/{{ tag | slug }}/
permalink: /tags/{{ tag | slugify }}/
---
<h1>Tagged “{{ tag }}”</h1>