fix: correct alternate link URL for markdown-agents
Add stripTrailingSlash filter and use it in the link tag so the alternate URL is /articles/.../slug.md (matching nginx routing) instead of /articles/.../slug/index.md.
This commit is contained in:
@@ -412,6 +412,11 @@ export default function (eleventyConfig) {
|
||||
.replace(/^-+|-+$/g, "");
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter("stripTrailingSlash", (url) => {
|
||||
if (!url || typeof url !== "string") return url || "";
|
||||
return url.endsWith("/") ? url.slice(0, -1) : url;
|
||||
});
|
||||
|
||||
// Hash filter for cache busting - generates MD5 hash of file content
|
||||
eleventyConfig.addFilter("hash", (filePath) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user