added possibility to unpublish pages
This commit is contained in:
parent
1d45dc8ffa
commit
7d0ec7dd4c
|
@ -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)
|
||||
})
|
||||
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
{ "category": "audio" }
|
||||
{
|
||||
"category": "audio",
|
||||
"published": true
|
||||
}
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
{ "category": "other" }
|
||||
{
|
||||
"category": "other",
|
||||
"published": true
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
title: stone throw
|
||||
layout: page.njk
|
||||
imgFeat: /work/images/stoneThrow/scanPage.png
|
||||
published: false
|
||||
sort: 1
|
||||
---
|
||||
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
{ "category": "work" }
|
||||
{
|
||||
"category": "work",
|
||||
"published": true
|
||||
}
|
||||
|
|
|
@ -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": {
|
||||
|
|
Loading…
Reference in New Issue