Filter out trashed and draft posts

This commit is contained in:
Will Boyd
2020-01-20 13:52:21 -05:00
parent f152455ba4
commit 69008ce7fb
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -37,6 +37,7 @@ function collectPosts(data, config) {
const turndownService = translator.initTurndownService();
const posts = getItemsOfType(data, 'post')
.filter(post => post.status[0] !== 'trash' && post.status[0] !== 'draft')
.map(post => ({
// meta data isn't written to file, but is used to help with other things
meta: {
+1 -1
View File
@@ -57,7 +57,7 @@ async function loadMarkdownFilePromise(post) {
let output = '---\n';
Object.entries(post.frontmatter).forEach(pair => {
const key = pair[0];
const value = pair[1].replace(/"/g, '\\"');
const value = (pair[1] || '').replace(/"/g, '\\"');
output += key + ': "' + value + '"\n';
});
output += '---\n\n' + post.content + '\n';