Skip to content

Commit 710e500

Browse files
committedJan 14, 2022
fixes
1 parent a41c4a1 commit 710e500

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
 

‎.eleventy.js

+17
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,23 @@ module.exports = function (eleventyConfig) {
4040
ul: true,
4141
})
4242

43+
eleventyConfig.addLinter(
44+
'Spelling check',
45+
function (content, inputPath, outputPath) {
46+
let words = 'lenght, .lenght, .rigth'.split(',')
47+
48+
// Eleventy 1.0+: use this.inputPath and this.outputPath instead
49+
if (inputPath.endsWith('.md')) {
50+
for (let word of words) {
51+
let regexp = new RegExp('\\b(' + word + ')\\b', 'gi')
52+
if (content.match(regexp)) {
53+
console.warn(`Spelling check (${inputPath}) Found: ${word}`)
54+
}
55+
}
56+
}
57+
}
58+
)
59+
4360
eleventyConfig.addPassthroughCopy('_src/assets')
4461
// eleventyConfig.addPassthroughCopy("_src/styles")
4562

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"git-url-parse": "^11.6.0",
3131
"henry-reader-bar": "https://henry-11ty-resources.s3.sa-east-1.amazonaws.com/Modules/henry-reader-bar-0.2.0.tgz",
3232
"henry-reading-time": "https://henry-11ty-resources.s3.sa-east-1.amazonaws.com/Modules/henry-reading-time-0.1.0.tgz",
33+
"markdown-it": "^12.3.0",
3334
"markdown-it-anchor": "^8.4.1",
3435
"markdown-it-highlightjs": "^3.5.0",
3536
"simple-git": "^2.45.1"

0 commit comments

Comments
 (0)
Please sign in to comment.