fix: remove unused code
This commit is contained in:
parent
91bf9a1d7b
commit
320b933c04
6 changed files with 16 additions and 35 deletions
|
@ -2,8 +2,6 @@ const dayjs = require("dayjs");
|
||||||
const utc = require("dayjs/plugin/utc");
|
const utc = require("dayjs/plugin/utc");
|
||||||
const advancedFormat = require("dayjs/plugin/advancedFormat");
|
const advancedFormat = require("dayjs/plugin/advancedFormat");
|
||||||
|
|
||||||
const postcss = require("postcss");
|
|
||||||
const cssnano = require("cssnano");
|
|
||||||
const pluralizeBase = require("pluralize");
|
const pluralizeBase = require("pluralize");
|
||||||
|
|
||||||
const keys = Object.keys;
|
const keys = Object.keys;
|
||||||
|
@ -13,12 +11,6 @@ const entries = Object.entries;
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
dayjs.extend(advancedFormat);
|
dayjs.extend(advancedFormat);
|
||||||
|
|
||||||
const minifyCss = async (css) => {
|
|
||||||
const output = await postcss([cssnano]).process(css, { from: undefined });
|
|
||||||
|
|
||||||
return output.css;
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatDate = (date, format) => dayjs.utc(date).format(format);
|
const formatDate = (date, format) => dayjs.utc(date).format(format);
|
||||||
|
|
||||||
const organizeByDate = (collection) => {
|
const organizeByDate = (collection) => {
|
||||||
|
@ -101,7 +93,6 @@ module.exports = {
|
||||||
formatDate,
|
formatDate,
|
||||||
keys,
|
keys,
|
||||||
limit,
|
limit,
|
||||||
minifyCss,
|
|
||||||
organizeByDate,
|
organizeByDate,
|
||||||
pluralize,
|
pluralize,
|
||||||
values,
|
values,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* Sourced from eleventy-excellent's youtube shortcode
|
/*
|
||||||
|
* Sourced from eleventy-excellent's youtube shortcode
|
||||||
* https://github.com/madrilene/eleventy-excellent/blob/main/config/shortcodes/youtube-lite/index.js
|
* https://github.com/madrilene/eleventy-excellent/blob/main/config/shortcodes/youtube-lite/index.js
|
||||||
*/
|
*/
|
||||||
const liteYoutube = (id, label) => {
|
const liteYoutube = (id, label) => {
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
const path = require("path").posix;
|
|
||||||
const slugify = require("slugify");
|
|
||||||
|
|
||||||
const slugifyString = (string) => {
|
|
||||||
return slugify(string, {
|
|
||||||
lower: true,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const getFontUrl = (src) => path.join("/assets/fonts", src);
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
getFontUrl,
|
|
||||||
slugifyString,
|
|
||||||
};
|
|
|
@ -6,18 +6,17 @@ const {
|
||||||
} = require("./config/collections/index.js");
|
} = require("./config/collections/index.js");
|
||||||
const { dir } = require("./config/constants.js");
|
const { dir } = require("./config/constants.js");
|
||||||
const {
|
const {
|
||||||
entries,
|
|
||||||
formatDate,
|
|
||||||
minifyCss,
|
|
||||||
values,
|
|
||||||
organizeByDate,
|
|
||||||
keys,
|
|
||||||
allTagCounts,
|
allTagCounts,
|
||||||
|
entries,
|
||||||
filter,
|
filter,
|
||||||
pluralize,
|
|
||||||
filterCatalogueTags,
|
filterCatalogueTags,
|
||||||
limit,
|
|
||||||
filterFavourites,
|
filterFavourites,
|
||||||
|
formatDate,
|
||||||
|
keys,
|
||||||
|
limit,
|
||||||
|
organizeByDate,
|
||||||
|
pluralize,
|
||||||
|
values,
|
||||||
} = require("./config/filters/index.js");
|
} = require("./config/filters/index.js");
|
||||||
const markdown = require("./config/plugins/markdown.js");
|
const markdown = require("./config/plugins/markdown.js");
|
||||||
const imageShortcode = require("./config/shortcodes/image.js");
|
const imageShortcode = require("./config/shortcodes/image.js");
|
||||||
|
@ -42,7 +41,6 @@ module.exports = (eleventyConfig) => {
|
||||||
eleventyConfig.addFilter("formatDate", formatDate);
|
eleventyConfig.addFilter("formatDate", formatDate);
|
||||||
eleventyConfig.addFilter("keys", keys);
|
eleventyConfig.addFilter("keys", keys);
|
||||||
eleventyConfig.addFilter("limit", limit);
|
eleventyConfig.addFilter("limit", limit);
|
||||||
eleventyConfig.addFilter("minifyCss", minifyCss);
|
|
||||||
eleventyConfig.addFilter("organizeByDate", organizeByDate);
|
eleventyConfig.addFilter("organizeByDate", organizeByDate);
|
||||||
eleventyConfig.addFilter("values", values);
|
eleventyConfig.addFilter("values", values);
|
||||||
eleventyConfig.addFilter("pluralize", pluralize);
|
eleventyConfig.addFilter("pluralize", pluralize);
|
||||||
|
|
|
@ -79,6 +79,10 @@ const blogroll = [
|
||||||
title: "Cory Dransfeldt",
|
title: "Cory Dransfeldt",
|
||||||
url: "https://coryd.dev/",
|
url: "https://coryd.dev/",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "HeydonWorks",
|
||||||
|
url: "https://heydonworks.com",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const sortedBlogroll = blogroll.sort((a, b) => a.title.localeCompare(b.title));
|
const sortedBlogroll = blogroll.sort((a, b) => a.title.localeCompare(b.title));
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
const { getFontUrl } = require("../../config/utils");
|
const path = require("path").posix;
|
||||||
const fonts = require("../../config/design-tokens/fonts.json");
|
const fonts = require("../../config/design-tokens/fonts.json");
|
||||||
|
|
||||||
|
const getFontUrl = (src) => path.join("/assets/fonts", src);
|
||||||
|
|
||||||
const fontsToCss = (fonts) => {
|
const fontsToCss = (fonts) => {
|
||||||
return Object.entries(fonts).reduce((css, [, fontProperties]) => {
|
return Object.entries(fonts).reduce((css, [, fontProperties]) => {
|
||||||
const family = fontProperties.family;
|
const family = fontProperties.family;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue