This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
website/.eleventy.js

28 lines
859 B
JavaScript

const { DateTime } = require("luxon")
const timeToRead = require("eleventy-plugin-time-to-read")
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy({ "static": "/" })
eleventyConfig.addPlugin(timeToRead, {
language: "es",
style: "long",
hours: "auto",
minutes: true,
})
eleventyConfig.addFilter("readableDate", dateObj => {
return DateTime.fromJSDate(dateObj, {zone: 'utc'}).setLocale("es-ES").toFormat("dd LLL yyyy");
})
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
eleventyConfig.addFilter('htmlDateString', dateObj => {
return DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat('yyyy-LL-dd');
})
return {
passthroughFileCopy: true,
dir: {
input: "src"
}
}
}