From 808e89b024bed961cecd06c9e987dd0349458b92 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 1 May 2020 13:44:35 -0400 Subject: Finally implemented blog posts --- nuxt.config.js | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'nuxt.config.js') diff --git a/nuxt.config.js b/nuxt.config.js index 7881a99..39370d1 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -11,12 +11,12 @@ module.exports = { { hid: 'description', name: 'description', content: 'Andrew\'s Personal Website' } ], link: [ - { - rel: 'icon', - type: 'image/x-icon', - href: 'favicon.ico', - } - ] + { + rel: 'icon', + type: 'image/x-icon', + href: 'favicon.ico' + } + ] }, /* ** Customize the progress-bar color @@ -41,7 +41,25 @@ module.exports = { /* ** Nuxt.js modules */ - modules: ['@nuxtjs/pwa'], + modules: ['@nuxtjs/pwa', '@nuxtjs/markdownit'], + + markdownit: { + injected: true + }, + + generate: { + routes: function () { + const fs = require('fs') + const path = require('path') + return fs.readdirSync('static/content/blog').map(file => { + return { + route: `/blog/${path.parse(file).name}`, // Return the slug + payload: require(`static/content/blog/${file}`) + } + }) + } + }, + /* ** vuetify module configuration ** https://github.com/nuxt-community/vuetify-module -- cgit v1.2.3