Skip to content

Commit

Permalink
blog 支持 md 文件
Browse files Browse the repository at this point in the history
  • Loading branch information
吴昀珠 committed Feb 2, 2019
1 parent 5f3dce4 commit 6a3eb4f
Show file tree
Hide file tree
Showing 20 changed files with 11,685 additions and 126 deletions.
19 changes: 19 additions & 0 deletions build/markdown-util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

var hljs = require('highlight.js');

var markdown = require('markdown-it')({
preset: 'default',
breaks: true,
html: true,
highlight: function (str, lang) {
if (!(lang && hljs.getLanguage(lang))) {
return '';
}

return hljs.highlight(lang, str, true).value;
}
});

markdown.use(require('markdown-it-anchor'))

module.exports = markdown;
7 changes: 7 additions & 0 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
var markdown = require('./markdown-util');
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')


function resolve (dir) {
return path.join(__dirname, '..', dir)
}
Expand All @@ -27,6 +29,11 @@ module.exports = {
},
module: {
rules: [
{
test: /\.md$/,
loader: 'vue-markdown-loader',
options: markdown
},
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
Expand Down
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><meta charset=utf-8><title>cboy-blog</title><link href=./static/css/app.fd2accbaadc35ee245741a7c7b7503c7.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.de7511c80ffd9e93b289.js></script><script type=text/javascript src=./static/js/vendor.fd1e11be2ac7834ed577.js></script><script type=text/javascript src=./static/js/app.e1fafb0ba261ff16cad4.js></script></body></html><style lang=less>* {
<!DOCTYPE html><html><head><meta charset=utf-8><title>cboy-blog</title><link href=./static/css/app.1f5f19da5cbcdbcec05a1b2bd2e8408f.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.0d72fe5b26def0c35394.js></script><script type=text/javascript src=./static/js/vendor.da6bd7dd775fc6a89d81.js></script><script type=text/javascript src=./static/js/app.759615ad3b80370f9ef7.js></script></body></html><style lang=less>* {
margin: 0;
padding: 0;
}
Expand Down
1 change: 0 additions & 1 deletion dist/static/css/app.fd2accbaadc35ee245741a7c7b7503c7.css

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6a3eb4f

Please sign in to comment.