aboutsummaryrefslogtreecommitdiff
path: root/plugins/withMarkdownLoader.js
diff options
context:
space:
mode:
authorflu0r1ne <flu0r1ne@flu0r1ne.net>2021-07-21 03:59:15 -0500
committerflu0r1ne <flu0r1ne@flu0r1ne.net>2021-07-21 03:59:15 -0500
commit437268370661087dbe31323efb18dfe1a518da33 (patch)
treecffc95cc50da55eced9ed1e3b68502c68f01ca19 /plugins/withMarkdownLoader.js
parent51967b62cd274b10326a604d4db670e9e89f8fd5 (diff)
downloadhomepage-437268370661087dbe31323efb18dfe1a518da33.tar.xz
homepage-437268370661087dbe31323efb18dfe1a518da33.zip
Dynamic markdown page generation with preloading
Diffstat (limited to 'plugins/withMarkdownLoader.js')
-rw-r--r--plugins/withMarkdownLoader.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/plugins/withMarkdownLoader.js b/plugins/withMarkdownLoader.js
index 7dd51b6..c1e0ac6 100644
--- a/plugins/withMarkdownLoader.js
+++ b/plugins/withMarkdownLoader.js
@@ -1,12 +1,6 @@
-const hljs = require('highlight.js');
const pluginFactory = require('./pluginFactory');
+const markedOptions = require('../utils/markedOptions');
-function highlight(code, lang) {
- const language = hljs.getLanguage(lang) ? lang : 'plaintext';
-
- const highlighted = hljs.highlight(code, { language }).value;
- return highlighted;
-}
const withMarkdownLoader = pluginFactory((config, _options) => {
config.module.rules.push({
@@ -20,9 +14,7 @@ const withMarkdownLoader = pluginFactory((config, _options) => {
},
{
loader: 'markdown-loader',
- options: {
- highlight
- }
+ options: markedOptions
}
]
});