@11ty/eleventy-upgrade-help 中文文档教程

发布于 3年前 浏览 25 项目主页 更新于 3年前

eleventy-upgrade-help

帮助您将 Eleventy 项目升级到新的主要版本的插件。 此插件的主要版本将始终与您要升级到的 Eleventy 的主要版本相匹配。

Usage

从 npm 安装:

npm install @11ty/eleventy-upgrade-help

添加到您的配置文件(可能是 .eleventy.js):

const UpgradeHelper = require("@11ty/eleventy-upgrade-help");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(UpgradeHelper);
};

Features

Swap from slug to slugify Filter

Issue 278。 当您想将现有的 slug 过滤器的使用换成新的 slugify 过滤器并想要比较任何可能已更改的 URL 时很有用。 在 Eleventy 文档上阅读有关slugslugify 转换的更多信息< /a>。

Data Deep Merge

问题 1753。 如果您不在默认值已更改的配置文件中使用 eleventyConfig.setDataDeepMerge,则会发出警告。

Liquid Options

问题 1390

  • Warns if you use strict_filters instead of strictFilters.
  • Warns if you don’t have strict_filters or strictFilters that the new default is true.
  • Warns if you don’t have dynamicPartials, the new default is true.

Non-root Input directory .gitignore

第 364 期。 如果你的输入目录不是 . 并且你有一个 .gitignore 文件在里面(例如 src/.gitignore),这个文件不再被支持.

  • {ROOT}/.gitignore
  • {INPUT_DIR}/.gitignore (removed in 1.0)
  • {ROOT}/.eleventyignore
  • {INPUT_DIR}/.eleventyignore

Feature Opt-out

const UpgradeHelper = require("@11ty/eleventy-upgrade-help");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(UpgradeHelper, {
    slugToSlugify: false,
    dataDeepMerge: false,
    liquidOptions: false,
    inputDirGitignore: false,
  });
};

eleventy-upgrade-help

A plugin to help you upgrade your Eleventy project to a new major version. The major version of this plugin will always match the major version of Eleventy that you’re upgrading to.

Usage

Install from npm:

npm install @11ty/eleventy-upgrade-help

Add to your configuration file (probably .eleventy.js):

const UpgradeHelper = require("@11ty/eleventy-upgrade-help");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(UpgradeHelper);
};

Features

Swap from slug to slugify Filter

Issue 278. Useful when you want to swap your existing use of the slug filter to the new slugify filter and want to compare any URLs that may have changed. Read more about the slug to slugify transition on the Eleventy docs.

Data Deep Merge

Issue 1753. Warns if you do not use eleventyConfig.setDataDeepMerge in your configuration file that the default value has changed.

Liquid Options

Issue 1390

  • Warns if you use strict_filters instead of strictFilters.
  • Warns if you don’t have strict_filters or strictFilters that the new default is true.
  • Warns if you don’t have dynamicPartials, the new default is true.

Non-root Input directory .gitignore

Issue 364. If your input directory is not . and you have a .gitignore file inside (e.g. src/.gitignore), this file is no longer supported.

  • {ROOT}/.gitignore
  • ???? {INPUT_DIR}/.gitignore (removed in 1.0)
  • {ROOT}/.eleventyignore
  • {INPUT_DIR}/.eleventyignore

Feature Opt-out

const UpgradeHelper = require("@11ty/eleventy-upgrade-help");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(UpgradeHelper, {
    slugToSlugify: false,
    dataDeepMerge: false,
    liquidOptions: false,
    inputDirGitignore: false,
  });
};
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文