Alphabetizes tags page
This commit is contained in:
parent
4f0a64d781
commit
87200eb4eb
2 changed files with 5 additions and 1 deletions
|
@ -5,7 +5,7 @@ layout: layouts/home.njk
|
||||||
<h1>Tags</h1>
|
<h1>Tags</h1>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for tag in collections.all | getAllTags | filterTagList %}
|
{% for tag in collections.all | getAllTags | filterTagList | sortAlphabetically %}
|
||||||
{% set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
|
{% set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
|
||||||
<li><a href="{{ tagUrl }}" class="post-tag">{{ tag }}</a></li>
|
<li><a href="{{ tagUrl }}" class="post-tag">{{ tag }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -78,6 +78,10 @@ module.exports = function(eleventyConfig) {
|
||||||
return (tags || []).filter(tag => ["all", "nav", "post", "posts"].indexOf(tag) === -1);
|
return (tags || []).filter(tag => ["all", "nav", "post", "posts"].indexOf(tag) === -1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eleventyConfig.addFilter("sortAlphabetically", strings =>
|
||||||
|
(strings || []).sort((b, a) => b.localeCompare(a))
|
||||||
|
);
|
||||||
|
|
||||||
// Customize Markdown library settings:
|
// Customize Markdown library settings:
|
||||||
eleventyConfig.amendLibrary("md", mdLib => {
|
eleventyConfig.amendLibrary("md", mdLib => {
|
||||||
mdLib.use(markdownItAnchor, {
|
mdLib.use(markdownItAnchor, {
|
||||||
|
|
Loading…
Add table
Reference in a new issue