Added support for drafts

This commit is contained in:
Marcus Noble 2016-07-26 10:08:49 +01:00
parent 85dbfe9fe6
commit a66f3bc760
2 changed files with 18 additions and 4 deletions

13
app.js
View File

@ -41,7 +41,7 @@ Metalsmith(__dirname)
site: { site: {
title: 'Marcus Noble', title: 'Marcus Noble',
description: 'Awesomeness with a side of geek', description: 'Awesomeness with a side of geek',
url: 'https://blog.marcusnoble.co.uk' url: 'http://localhost:8000' // 'https://blog.marcusnoble.co.uk'
} }
})) }))
.use(date()) .use(date())
@ -51,6 +51,11 @@ Metalsmith(__dirname)
sortBy: 'date', sortBy: 'date',
reverse: true, reverse: true,
}, },
drafts: {
pattern: 'drafts/*',
sortBy: 'date',
reverse: true,
},
projects: { projects: {
pattern: 'projects/*' pattern: 'projects/*'
}, },
@ -76,6 +81,10 @@ Metalsmith(__dirname)
{ {
match: { collection: 'pages' }, match: { collection: 'pages' },
pattern: ':title' pattern: ':title'
},
{
match: { collection: 'drafts' },
pattern: 'drafts/:title'
} }
] ]
})) }))
@ -107,4 +116,4 @@ Metalsmith(__dirname)
app.listen(port, function () { app.listen(port, function () {
console.log(`App listening on port ${port}`); console.log(`App listening on port ${port}`);
}); });
}); });

View File

@ -37,6 +37,7 @@ a {
pre code { pre code {
overflow: scroll; overflow: scroll;
padding-bottom: 15px;
} }
figure p { figure p {
@ -237,7 +238,7 @@ nav {
margin-bottom: 100px; margin-bottom: 100px;
a { a {
font-size: 1.3em; font-size: 1.2em;
} }
img{ img{
@ -245,6 +246,10 @@ nav {
max-width: 100%; max-width: 100%;
margin: 0 auto; margin: 0 auto;
} }
p > code {
border: 1px dotted;
}
} }
.pagination { .pagination {
@ -296,4 +301,4 @@ nav {
height: 100px; height: 100px;
background-size: cover; background-size: cover;
background-position: center; background-position: center;
} }