Replace orderBySectionOrder filter with the built in sort filter
This commit is contained in:
parent
db6c23d907
commit
7db728e7da
|
@ -56,9 +56,6 @@ module.exports = function (eleventyConfig) {
|
|||
return true;
|
||||
});
|
||||
});
|
||||
eleventyConfig.addFilter("orderBySectionOrder", (collection) =>
|
||||
collection.sort((a, b) => a.data.sectionOrder - b.data.sectionOrder)
|
||||
);
|
||||
eleventyConfig.addFilter("log", (value) => console.log(value));
|
||||
|
||||
return {
|
||||
|
|
|
@ -7,7 +7,7 @@ eleventyNavigation:
|
|||
tags: [ "MainPage" ]
|
||||
---
|
||||
|
||||
{% for section in collections.MainPage | IsNotPage(page.url) | IsMainPageSection | orderBySectionOrder %}
|
||||
{% for section in collections.MainPage | IsNotPage(page.url) | IsMainPageSection | sort(false, false, "data.sectionOrder") %}
|
||||
{% if not loop.first %}
|
||||
<h2 id="{{ section.data.title | slugify }}">{{ section.data.title }}</h2>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue