diff --git a/dist/.gitkeep b/dist/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/eleventy.config.js b/eleventy.config.js index d55e31d..e006f34 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -1,9 +1,11 @@ import browserslist from 'browserslist'; import { transform, browserslistToTargets } from 'lightningcss'; import markdownIt from 'markdown-it'; +import { eleventyImagePlugin } from '@11ty/eleventy-img'; import webc from '@11ty/eleventy-plugin-webc'; import syntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight'; import renderSvg from './lib/renderSvg.js'; +import findCollectionItem from './lib/findCollectionItem.js'; async function transformCSS(content) { if (this.type !== 'css') { @@ -28,9 +30,23 @@ export default function(eleventyConfig) { eleventyConfig.addWatchTarget('src/styles/*.css'); // make functions available globally in templates eleventyConfig.addJavaScriptFunction('renderSvg', renderSvg); + eleventyConfig.addJavaScriptFunction('findCollectionItem', findCollectionItem); + // support eleventy-image https://www.11ty.dev/docs/plugins/image + eleventyConfig.addPlugin(eleventyImagePlugin, { + formats: ['webp'], + widths: [800, 1600], + urkPath: '/assets/images/', + defaultAttributes: { + sizes: '100vw', + loading: 'lazy', + }, + }); // load all components added to the src/components directory eleventyConfig.addPlugin(webc, { - components: 'src/components/**/*.webc', + components: [ + 'src/components/**/*.webc', + 'npm:@11ty/eleventy-img/*.webc', + ], bundlePluginOptions: { transforms: [transformCSS], }, diff --git a/lib/findCollectionItem.js b/lib/findCollectionItem.js new file mode 100644 index 0000000..0c04f6b --- /dev/null +++ b/lib/findCollectionItem.js @@ -0,0 +1,9 @@ +/** + * Find an item within a collection by it’s url + * @param {Array} collection the collection to search + * @param {String} url the url of the item to search for + * @returns A collection item or undefined + */ +export default function findCollectionItem(collection = [], url = '') { + return collection.find(post => post.url === url); +} \ No newline at end of file diff --git a/src/docs/index.webc b/src/docs/index.webc deleted file mode 100644 index a0ac3b7..0000000 --- a/src/docs/index.webc +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: docs.webc -tags: ['docs', 'Getting started'] -title: The problem -description: How do you create and organise components in a way that is scalable and maintainable over time? -icon: warning ---- - - diff --git a/src/docs/the-problem/hero.webp b/src/docs/the-problem/hero.webp new file mode 100644 index 0000000..a1452ec Binary files /dev/null and b/src/docs/the-problem/hero.webp differ diff --git a/src/docs/the-problem/index.webc b/src/docs/the-problem/index.webc new file mode 100644 index 0000000..f33d270 --- /dev/null +++ b/src/docs/the-problem/index.webc @@ -0,0 +1,110 @@ +--- +layout: docs.webc +tags: ['docs', 'Getting started'] +title: The problem +description: How do you create and organise components in a way that is scalable and maintainable over time? +icon: warning +permalink: /docs/index.html +next: /docs/the-solution/ +--- + + \ No newline at end of file diff --git a/src/docs/the-problem/max-hero.webp b/src/docs/the-problem/max-hero.webp new file mode 100644 index 0000000..5d4d925 Binary files /dev/null and b/src/docs/the-problem/max-hero.webp differ diff --git a/src/docs/the-problem/yellow-hero.webp b/src/docs/the-problem/yellow-hero.webp new file mode 100644 index 0000000..37dad57 Binary files /dev/null and b/src/docs/the-problem/yellow-hero.webp differ diff --git a/src/docs/the-solution.webc b/src/docs/the-solution.webc deleted file mode 100644 index bbc841c..0000000 --- a/src/docs/the-solution.webc +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: docs.webc -tags: ['docs', 'Getting started'] -title: The solution -description: Diamond UI is a method of organising and grouping components to cleanly separate their responsibilities. -icon: tick ---- diff --git a/src/docs/the-solution/index.webc b/src/docs/the-solution/index.webc new file mode 100644 index 0000000..7cccd3b --- /dev/null +++ b/src/docs/the-solution/index.webc @@ -0,0 +1,67 @@ +--- +layout: docs.webc +tags: ['docs', 'Getting started'] +title: The solution +description: Diamond UI is a method of organising and grouping components to cleanly separate their responsibilities. +icon: tick +previous: /docs/ +next: /docs/content/ +--- + + diff --git a/src/layouts/docs.webc b/src/layouts/docs.webc index f582471..0b0e10b 100644 --- a/src/layouts/docs.webc +++ b/src/layouts/docs.webc @@ -37,7 +37,25 @@ layout: default.webc -
+
+ + + + + +

+

+ + +

+
+
+
+
\ No newline at end of file diff --git a/src/styles/theme.css b/src/styles/theme.css index 0c755e1..c7f662f 100644 --- a/src/styles/theme.css +++ b/src/styles/theme.css @@ -5,6 +5,7 @@ --diamond-theme-link-color: var(--color-blue-light); --diamond-theme-border-color: var(--color-blue-dark); --diamond-theme-background-muted: var(--color-blue-dark); + --diamond-theme-border-color-hover: var(--color-blue-light); } .theme-medium { diff --git a/src/styles/util.css b/src/styles/util.css index 4242197..af497e0 100644 --- a/src/styles/util.css +++ b/src/styles/util.css @@ -21,4 +21,8 @@ .fill { display: grid; height: 100%; +} + +.text-title-case { + text-transform: capitalize; } \ No newline at end of file