Adds https://github.com/11ty/eleventy/issues/386 to default eleventy-base-blog config
This commit is contained in:
parent
d0c924e963
commit
e2be85925d
15
.eleventy.js
15
.eleventy.js
@ -1,4 +1,5 @@
|
|||||||
const { DateTime } = require("luxon");
|
const { DateTime } = require("luxon");
|
||||||
|
const fs = require("fs");
|
||||||
const pluginRss = require("@11ty/eleventy-plugin-rss");
|
const pluginRss = require("@11ty/eleventy-plugin-rss");
|
||||||
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
|
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
|
||||||
|
|
||||||
@ -50,6 +51,20 @@ module.exports = function(eleventyConfig) {
|
|||||||
.use(markdownItAnchor, opts)
|
.use(markdownItAnchor, opts)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
eleventyConfig.setBrowserSyncConfig({
|
||||||
|
callbacks: {
|
||||||
|
ready: function(err, browserSync) {
|
||||||
|
const content_404 = fs.readFileSync('_site/404.html');
|
||||||
|
|
||||||
|
browserSync.addMiddleware("*", (req, res) => {
|
||||||
|
// Provides the 404 content without redirect.
|
||||||
|
res.write(content_404);
|
||||||
|
res.end();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
templateFormats: [
|
templateFormats: [
|
||||||
"md",
|
"md",
|
||||||
|
Loading…
Reference in New Issue
Block a user