diff options
author | Indrajith K L | 2022-11-20 04:59:39 +0530 |
---|---|---|
committer | Indrajith K L | 2022-11-20 04:59:39 +0530 |
commit | ff11d9e237e51a5eb40690e44f690108ac7175b7 (patch) | |
tree | a6db124e19c9f3ae5dfffe3bc1e8d4028e8225ce /.eleventy.js | |
parent | 143915cc03764082fd97d484fd3c0f3b7c018c89 (diff) | |
download | indrajith-dev-ff11d9e237e51a5eb40690e44f690108ac7175b7.tar.gz indrajith-dev-ff11d9e237e51a5eb40690e44f690108ac7175b7.tar.bz2 indrajith-dev-ff11d9e237e51a5eb40690e44f690108ac7175b7.zip |
Website Updatefeature/remove-tailwind
* Full Rewrite
* Removed Tailwind CSS
* Stripdowned to barebone css
Diffstat (limited to '.eleventy.js')
-rw-r--r-- | .eleventy.js | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/.eleventy.js b/.eleventy.js index 3089f6c..fbf989e 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -5,10 +5,11 @@ const faviconPlugin = require("eleventy-favicon"); const eleventyPluginFeathericons = require("eleventy-plugin-feathericons"); const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); const pluginRss = require("@11ty/eleventy-plugin-rss"); +const _ = require("lodash"); module.exports = function (config) { config.addPassthroughCopy({ - "src/_includes/assets/css/styles.css": "./global.css", + "src/css/styles.css": "./styles.css", }); config.addPassthroughCopy({ "src/css/fonts": "./fonts", @@ -33,10 +34,26 @@ module.exports = function (config) { }); function filterTagList(tags) { - return (tags || []).filter(tag => ["all", "nav", "post", "posts"].indexOf(tag) === -1); + return (tags || []).filter( + (tag) => ["all", "nav", "post", "posts"].indexOf(tag) === -1 + ); } - config.addFilter("filterTagList", filterTagList) + config.addCollection("postsByYear", (collection) => { + return _.chain( + collection.getAllSorted().filter((post) => { + return post.data.tags?.includes("posts"); + }) + ) + .groupBy((post) => { + return dayjs(post.date).format("DD MMM YYYY"); + }) + .toPairs() + .reverse() + .value(); + }); + + config.addFilter("filterTagList", filterTagList); return { dir: { |