@11ty/eleventy-plugin-inclusive-language 中文文档教程
eleventy-plugin-inclusive-language
一个 Eleventy linter 插件,用于检查降价文件中的包容性语言。 灵感来自 CSS Tricks' Words to Avoid in Educational Writing。 这里没有浏览器/客户端 JavaScript——这个插件的一切都是在构建时完成的。
Installation
可在 npm。
npm install @11ty/eleventy-plugin-inclusive-language --save-dev
打开你的 Eleventy 配置文件(可能是 .eleventy.js
)并使用 addPlugin
:
const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(inclusiveLangPlugin);
};
阅读更多关于 Eleventy 插件。
Options
可选择将选项对象作为第二个参数传递给 addPlugin
以进一步自定义此插件。
const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(inclusiveLangPlugin, {
templateFormats: ["md"], // default, add more file extensions here
// accepts an array or a comma-delimited string
words: "simply,obviously,basically,of course,clearly,just,everyone knows,however,easy"
});
};
eleventy-plugin-inclusive-language
An Eleventy linter plugin to check for inclusive language in markdown files. Inspired by CSS Tricks’ Words to Avoid in Educational Writing. No browser/client JavaScript here—everything is this plugin is done at build-time.
Installation
Available on npm.
npm install @11ty/eleventy-plugin-inclusive-language --save-dev
Open up your Eleventy config file (probably .eleventy.js
) and use addPlugin
:
const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(inclusiveLangPlugin);
};
Read more about Eleventy plugins.
Options
Optionally pass in an options object as the second argument to addPlugin
to further customize this plugin.
const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(inclusiveLangPlugin, {
templateFormats: ["md"], // default, add more file extensions here
// accepts an array or a comma-delimited string
words: "simply,obviously,basically,of course,clearly,just,everyone knows,however,easy"
});
};