An Eleventy plugin for generating /resource
-style URLs.
This plugin implements the example code from the Eleventy permalinks documentation. The section, "Removing trailing slashes," details the trade-offs and deployment concerns in using the configuration supplied by this plugin.
First, add the plugin as a development dependency to your project's package.json
file:
npm install --save-dev @jgarber/eleventy-plugin-routes
Next, add the plugin to your project's Eleventy configuration file (e.g. eleventy.config.js
):
import eleventyPluginRoutes from "@jgarber/eleventy-plugin-routes";
export default async function(eleventyConfig) {
eleventyConfig.addPlugin(eleventyPluginRoutes);
}
🏆 That's it! Your Eleventy project should now default to generating resource.html
-style pages and return /resource
-style URLs from page.url
entries.
First and foremost, eleventy-plugin-routes wouldn't be possible without Zach Leatherman's incredible work creating Eleventy and his stewardship of its community.
eleventy-plugin-routes is written and maintained by Jason Garber.