This repository has been archived on 2024-02-11. You can view files and clone it, but cannot push or open issues or pull requests.
sitio/.eleventy.js
Cat /dev/Nulo eabab27df5
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
linkear bien a la carpeta
2023-11-20 13:22:48 -03:00

53 lines
1.9 KiB
JavaScript

const { basename } = require("path");
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
const automaticNoopener = require("eleventy-plugin-automatic-noopener");
const markdownItWikilinks = require("markdown-it-wikilinks")({
uriSuffix: "",
generatePagePathFromLabel: (label) => `${label}/`,
postProcessPagePath: (path) => path,
postProcessLabel: (path) => basename(path).match(/^(?:(?:\d{4})-(?:\d{2})-(?:\d{2})-)?(.+)$/)[1],
relativeBaseURL: "../",
});
const { formatDate } = require("./helpers/date");
/**
* @param {import("@11ty/eleventy").UserConfig} eleventyConfig
*/
module.exports = function config(eleventyConfig) {
eleventyConfig.addPassthroughCopy("drip.css");
eleventyConfig.addPassthroughCopy("cowboy.svg");
eleventyConfig.addPassthroughCopy("status/*");
eleventyConfig.addPassthroughCopy("redirects.caddy");
eleventyConfig.addPassthroughCopy("x/**/*.png");
eleventyConfig.addPassthroughCopy("x/**/*.jpg");
eleventyConfig.addPassthroughCopy("x/**/*.mp4");
eleventyConfig.addPassthroughCopy("bookmarks/**/*.png");
eleventyConfig.addPassthroughCopy("bookmarks/**/*.jpg");
eleventyConfig.addPassthroughCopy("bookmarks/**/*.mp4");
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
eleventyConfig.addPlugin(automaticNoopener, {
noreferrer: false,
});
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownItWikilinks));
eleventyConfig.addCollection("x", (collectionApi) => collectionApi.getFilteredByGlob("x/**/*"));
eleventyConfig.addShortcode(
"dateToISO",
/** @param {Date} date */ (date) => date.toISOString().slice(0, 10),
);
eleventyConfig.addShortcode("formatDate", formatDate);
eleventyConfig.addShortcode("relativeLink", (link, baseUrl) => new URL(link, baseUrl).toString());
// eleventyConfig.addShortcode("formatDateish", formatDateish);
// eleventyConfig.addShortcode("dateishToElement", dateishToElement);
return {
dir: {
output: "build",
},
};
};