diff --git a/.eleventy.js b/.eleventy.js index 1a1272b..bb8792b 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,15 +1,35 @@ +const { DateTime } = require("luxon") const markdownIt = require("markdown-it"); const markdownItAnchor = require("markdown-it-anchor"); +const timeToRead = require("eleventy-plugin-time-to-read") module.exports = function(eleventyConfig) { eleventyConfig.addPassthroughCopy({ "static": "/" }) + eleventyConfig.addPlugin(timeToRead, { + language: "en", + style: "long", + hours: "auto", + minutes: true, + }) + eleventyConfig.setLibrary("md", markdownIt({ html: true }).use(markdownItAnchor, { level: 2 })) + eleventyConfig.addFilter("relevantTags", tags => tags.filter(v => !["archived", "post"].includes(v))) + + 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: { diff --git a/README.md b/README.md index d2e261d..7af4082 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,5 @@ -# Eleventy Base +# sofi web -A template for creating [11ty](https://www.11ty.dev/docs/) websites. +My personal website :) -## Getting started - -Run `yarn` to resolve the dependencies. - -Make sure to check the following files and change them according to your needs: -* [src/_includes/base_page.njk](src/_includes/base_page.njk). This is the base page, you should change the title of the -page. -* [static/css/base.css](static/css/base.css). This is the base theme, you should at least change the colors. - -After changing the files, run `yarn serve` to serve the website. +[sofiaritz.com](https://sofiaritz.com) \ No newline at end of file diff --git a/package.json b/package.json index 9a4cea6..aa91861 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "private": true, "devDependencies": { "@11ty/eleventy": "^2.0.1", + "eleventy-plugin-time-to-read": "^1.3.0", + "luxon": "^3.4.4", "markdown-it": "^13.0.2", "markdown-it-anchor": "^8.6.7" }, diff --git a/src/_includes/base_page.njk b/src/_includes/base_page.njk index 9097866..80f74f8 100644 --- a/src/_includes/base_page.njk +++ b/src/_includes/base_page.njk @@ -5,25 +5,76 @@ - -