mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-09 12:30:51 +00:00
feat(11ty): skip items which have skip flag set in toc
This commit is contained in:
parent
6e087a9abe
commit
488a5cdafd
@ -54,6 +54,7 @@ module.exports = function (config) {
|
|||||||
config.addCollection('tableOfContent', collection => {
|
config.addCollection('tableOfContent', collection => {
|
||||||
const allItems = collection
|
const allItems = collection
|
||||||
.getFilteredByGlob('./11ty/definitions/*.md')
|
.getFilteredByGlob('./11ty/definitions/*.md')
|
||||||
|
.filter(word => !word.data.skip_in_table_of_content)
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
// `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.title.toLowerCase().localeCompare(b.data.title.toLowerCase())
|
return a.data.title.toLowerCase().localeCompare(b.data.title.toLowerCase())
|
||||||
@ -83,7 +84,7 @@ module.exports = function (config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
allItems.forEach(word => {
|
allItems.forEach(word => {
|
||||||
const { title } = word.data
|
const { title, skip_in_table_of_content } = word.data
|
||||||
const { notLetters, aToE, fToL, mToS, tToZ } = split
|
const { notLetters, aToE, fToL, mToS, tToZ } = split
|
||||||
|
|
||||||
if (/^[a-e]/gmi.test(title)) {
|
if (/^[a-e]/gmi.test(title)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user