gallery categories modularized, removed music lists, added listenbrainz to outgoing, icons, css cleanup
This commit is contained in:
parent
1945abd6ad
commit
d376e04015
24 changed files with 474 additions and 606 deletions
|
|
@ -4,72 +4,33 @@ import slugify from "slugify";
|
|||
import { format } from "date-fns";
|
||||
|
||||
export default async function (eleventyConfig) {
|
||||
/*
|
||||
|
||||
const linkAfterHeader = markdownItAnchor.permalink.linkAfterHeader({
|
||||
class: "anchor",
|
||||
symbol: "<span hidden>#</span>",
|
||||
style: "aria-labelledby",
|
||||
});
|
||||
const markdownItAnchorOptions = {
|
||||
level: [1, 2, 3],
|
||||
slugify: (str) =>
|
||||
slugify(str, {
|
||||
lower: true,
|
||||
strict: true,
|
||||
remove: /["]/g,
|
||||
}),
|
||||
tabIndex: false,
|
||||
permalink(slug, opts, state, idx) {
|
||||
state.tokens.splice(
|
||||
idx,
|
||||
0,
|
||||
Object.assign(new state.Token("div_open", "div", 1), {
|
||||
// Add class "header-wrapper [h1 or h2 or h3]"
|
||||
attrs: [["class", `heading-wrapper ${state.tokens[idx].tag}`]],
|
||||
block: true,
|
||||
})
|
||||
);
|
||||
|
||||
state.tokens.splice(
|
||||
idx + 4,
|
||||
0,
|
||||
Object.assign(new state.Token("div_close", "div", -1), {
|
||||
block: true,
|
||||
})
|
||||
);
|
||||
|
||||
linkAfterHeader(slug, opts, state, idx + 1);
|
||||
},
|
||||
};
|
||||
let markdownLibrary = markdownIt({
|
||||
html: true,
|
||||
}).use(markdownItAnchor, markdownItAnchorOptions);
|
||||
eleventyConfig.setLibrary("md", markdownLibrary);
|
||||
|
||||
*/
|
||||
const assets = "./_src/assets/";
|
||||
eleventyConfig.addPassthroughCopy(assets);
|
||||
eleventyConfig.addWatchTarget(assets);
|
||||
eleventyConfig.addFilter("sortByFirstDate", items => items.sort((a, b) => new Date(b.data.images[0].date) - new Date(a.data.images[0].date)));
|
||||
eleventyConfig.addFilter("link", function(text, url) {
|
||||
return `<a href="${url}"><img src="https://www.google.com/s2/favicons?domain=${url}" alt=""/>${text}</a>`;
|
||||
});
|
||||
eleventyConfig.addFilter("ISO", (dateObj) => {
|
||||
return format(dateObj, ("yyyy-LL-dd"));
|
||||
});
|
||||
eleventyConfig.addFilter("readable", (dateObj) => {
|
||||
return format(dateObj, ("LLLL do, yyyy"));
|
||||
});
|
||||
eleventyConfig.setBrowserSyncConfig({
|
||||
open: true,
|
||||
});
|
||||
};
|
||||
const assets = "./_src/assets/";
|
||||
eleventyConfig.addPassthroughCopy(assets);
|
||||
eleventyConfig.addWatchTarget(assets);
|
||||
eleventyConfig.addFilter("sortByFirstDate", (items) =>
|
||||
items.sort(
|
||||
(a, b) =>
|
||||
new Date(b.data.images[0].date) -
|
||||
new Date(a.data.images[0].date),
|
||||
),
|
||||
);
|
||||
eleventyConfig.addFilter("link", function (text, url) {
|
||||
return `<a href="${url}"><img src="https://www.google.com/s2/favicons?domain=${url}" alt="" aria-hidden="true"/>${text}</a>`;
|
||||
});
|
||||
eleventyConfig.addFilter("ISO", (dateObj) => {
|
||||
return format(dateObj, "yyyy-LL-dd");
|
||||
});
|
||||
eleventyConfig.addFilter("readable", (dateObj) => {
|
||||
return format(dateObj, "LLLL do, yyyy");
|
||||
});
|
||||
eleventyConfig.setBrowserSyncConfig({
|
||||
open: true,
|
||||
});
|
||||
}
|
||||
|
||||
export const config = {
|
||||
dir: {
|
||||
input: "_src",
|
||||
output: "_site"
|
||||
}
|
||||
dir: {
|
||||
input: "_src",
|
||||
output: "_site",
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue