mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-09 12:30:51 +00:00
feat(11ty): sort defintions by title
This commit is contained in:
parent
c15826cb73
commit
f8469baf5f
@ -28,7 +28,7 @@ module.exports = function (config) {
|
|||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
// `toLowerCase()` is just a safety measure, slugs should be lower case anyway
|
// `toLowerCase()` is just a safety measure, slugs should be lower case anyway
|
||||||
// `localeCompare()` is super cool: http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
|
// `localeCompare()` is super cool: http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
|
||||||
return a.data.slug.toLowerCase().localeCompare(b.data.slug.toLowerCase())
|
return a.data.title.toLowerCase().localeCompare(b.data.title.toLowerCase())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -37,9 +37,8 @@ module.exports = function (config) {
|
|||||||
.getFilteredByGlob('./11ty/definitions/*.md')
|
.getFilteredByGlob('./11ty/definitions/*.md')
|
||||||
.filter(word => word.data.defined)
|
.filter(word => word.data.defined)
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
// `toLowerCase()` is just a safety measure, slugs should be lower case anyway
|
|
||||||
// `localeCompare()` is super cool: http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
|
// `localeCompare()` is super cool: http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
|
||||||
return a.data.slug.toLowerCase().localeCompare(b.data.slug.toLowerCase())
|
return a.data.title.toLowerCase().localeCompare(b.data.title.toLowerCase())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user