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
Sofía Aritz ba9b759e53 Implement weblog
Missing RSS, comments and tags.
2023-03-12 13:57:29 +01:00

27 lines
853 B
JavaScript

const { DateTime } = require("luxon")
const timeToRead = require("eleventy-plugin-time-to-read")
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("css")
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
}
}