portfolio content, styling
Some checks failed
Build / Deploy (push) Failing after 2m24s

This commit is contained in:
Rik Berkelder 2025-02-13 20:56:23 +01:00
parent afcdd8ed12
commit 2d182e6391
70 changed files with 367 additions and 120 deletions

View file

@ -29,11 +29,13 @@ export default async function (eleventyConfig) {
});
//Images
eleventyConfig.addPlugin(eleventyImageTransformPlugin);
eleventyConfig.addShortcode("figure", (url, alt, caption) => {
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
widths: ["700"]
});
eleventyConfig.addShortcode("figure", (url, alt, caption, width) => {
return `
<figure>
<img src="${url}" alt="${alt}" />
<img src="${url}" alt="${alt}" width="${width || "700"}" />
<figcaption>${caption}</figcaption>
</figure>
`;
@ -52,6 +54,14 @@ export default async function (eleventyConfig) {
//File passthrough
eleventyConfig.addPassthroughCopy("content/robots.txt");
// Portfolio sort
eleventyConfig.addCollection("portfolioSorted", (collectionsAPi) => {
const portfolio = collectionsAPi.getFilteredByTag("portfolio");
const sorted = portfolio.sort((a, b) => a.data.order - b.data.order);
return sorted;
});
}
export const config = {