diff --git a/_posts/blog/2019-08-09-ide-to.md b/_posts/blog/dev-2019-08-09-ide-to.md similarity index 100% rename from _posts/blog/2019-08-09-ide-to.md rename to _posts/blog/dev-2019-08-09-ide-to.md diff --git a/_posts/blog/2019-11-03-anothert-one.md b/_posts/blog/dev-2019-11-03-anothert-one.md similarity index 100% rename from _posts/blog/2019-11-03-anothert-one.md rename to _posts/blog/dev-2019-11-03-anothert-one.md diff --git a/src/routes/blog/[slug].svelte b/src/routes/blog/[slug].svelte index d3a72b7..17c3847 100644 --- a/src/routes/blog/[slug].svelte +++ b/src/routes/blog/[slug].svelte @@ -26,10 +26,6 @@ so we have to use the :global(...) modifier to target all elements inside .content */ - .content :global(h2) { - font-size: 1.4em; - font-weight: 500; - } .content :global(pre) { background-color: #f9f9f9; diff --git a/src/routes/blog/index.json.js b/src/routes/blog/index.json.js index 56fda28..2e11a97 100644 --- a/src/routes/blog/index.json.js +++ b/src/routes/blog/index.json.js @@ -4,11 +4,18 @@ import { basename } from 'path' import fm from 'front-matter' import marked from 'marked' +const { NODE_ENV } = process.env + export async function get(req, res) { const files = await promisify(readdir)(`_posts/blog/`, 'utf-8') + const filteredFiles = + NODE_ENV !== 'production' + ? files + : files.filter(file => !file.startsWith('dev-')) + const contents = await Promise.all( - files.map(async file => { + filteredFiles.map(async file => { const fileContent = await promisify(readFile)( `_posts/blog/${file}`, 'utf-8' diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 4d9c55c..f0e5e23 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -11,13 +11,6 @@ margin: 0 auto; } - h1 { - font-size: 2.8em; - text-transform: uppercase; - font-weight: 700; - margin: 0 0 0.5em 0; - } - figure { margin: 0 0 1em 0; }