Skip to content
Snippets Groups Projects
Commit 4b5c45c6 authored by squidfunk's avatar squidfunk Committed by Martin Donath
Browse files

Refactored search language handling

parent f9159285
Branches
Tags
No related merge requests found
......@@ -156,6 +156,20 @@ module.exports = env => {
/* Write theme version into template */
.replace("$md-name$", metadata.name)
.replace("$md-version$", metadata.version)
/* Write available search languages into template */
.replace("$md-lunr-languages$",
fs.readdirSync(
path.resolve(__dirname, "node_modules/lunr-languages")
).reduce((files, file) => {
const matches = file.match(/lunr.(\w{2}).js$/)
if (matches) {
const [, language] = matches
files.push(`"${language}"`)
}
return files
}, [])
.join(", "))
}
}
]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment