Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 2.71 KB

upgrade-help.md

File metadata and controls

88 lines (61 loc) · 2.71 KB
eleventyNavigation
key title order excerpt
Upgrade Helper
<i class="fa-solid fa-circle-up"></i>Upgrade Helper
1
A plugin to help you upgrade your Eleventy project between major version releases.

Major Version Upgrade Helper

{% tableofcontents %}

Usage

Step 1 Upgrade Eleventy

Upgrade your project’s version of Eleventy with npm before using this helper plugin.

Upgrading from Eleventy v0 to v1:

{%- set codeBlock %} npm install @11ty/eleventy@1 {%- endset %} {{ codeBlock | highlight("bash") | safe }}

Or, upgrading from Eleventy v1 to v2:

{%- set codeBlock %} npm install @11ty/eleventy@2 {%- endset %} {{ codeBlock | highlight("bash") | safe }}

Or, upgrading from Eleventy v2 to v3: {%- set codeBlock %} npm install @11ty/eleventy@3 {%- endset %} {{ codeBlock | highlight("bash") | safe }}

Step 2 Install the Helper

Then, install the helper plugin. The major version will match the version of Eleventy that you’re upgrading to.

Upgrading from Eleventy v0 to v1:

{%- set codeBlock %} npm install @11ty/eleventy-upgrade-help@1 {%- endset %} {{ codeBlock | highlight("bash") | safe }}

Or, upgrading from Eleventy v1 to v2:

{%- set codeBlock %} npm install @11ty/eleventy-upgrade-help@2 {%- endset %} {{ codeBlock | highlight("bash") | safe }}

Or, upgrading from Eleventy v2 to v3:

{%- set codeBlock %} npm install @11ty/eleventy-upgrade-help@3 {%- endset %} {{ codeBlock | highlight("bash") | safe }}

Step 3 Add to Configuration File

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

{% set codeContent %} import UpgradeHelper from "@11ty/eleventy-upgrade-help";

export default function (eleventyConfig) { // If you have other addPlugin calls, it’s important that UpgradeHelper is added last. eleventyConfig.addPlugin(UpgradeHelper); }; {% endset %} {% include "snippets/configDefinition.njk" %}

Step 4 Run your Build

Run your usual build command (e.g. npm run build) and pay attention to the output. Address any violations and warnings.

Step 5 Remove the plugin

Once you’ve removed all of the violations/warnings from your output, run npm uninstall @11ty/eleventy-upgrade-help to remove the plugin and delete the plugin code from your Eleventy configuration file.