added possibility to unpublish pages

This commit is contained in:
suroh 2023-09-03 21:43:03 +02:00
parent 1d45dc8ffa
commit 7d0ec7dd4c
6 changed files with 17 additions and 5 deletions

View File

@ -26,7 +26,7 @@ module.exports = (config) => {
config.addCollection('pages', (collection) => {
let sorted = []
let unsorted = []
const pages = collection.getFilteredByGlob('**/*.md')
let pages = collection.getFilteredByGlob('**/*.md')
for (let page of pages) {
if (page.data.sort) {
@ -40,6 +40,8 @@ module.exports = (config) => {
}
}
sorted = sorted.filter(p => p.data.published)
return sorted.concat(unsorted)
})

View File

@ -1 +1,4 @@
{ "category": "audio" }
{
"category": "audio",
"published": true
}

View File

@ -1 +1,4 @@
{ "category": "other" }
{
"category": "other",
"published": true
}

View File

@ -2,6 +2,7 @@
title: stone throw
layout: page.njk
imgFeat: /work/images/stoneThrow/scanPage.png
published: false
sort: 1
---

View File

@ -1 +1,4 @@
{ "category": "work" }
{
"category": "work",
"published": true
}

View File

@ -2,7 +2,6 @@
"name": "work.suroh.tk",
"version": "1.1.0",
"description": "",
"main": "index.js",
"dependencies": {
"markdown-it": "^13.0.1",
"markdown-it-link-attributes": "^4.0.1"
@ -11,6 +10,7 @@
"@11ty/eleventy": "^0.9.0"
},
"scripts": {
"dev": "eleventy --serve",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {