Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2 #11

Merged
merged 61 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d1b447e
feat: the same site, but with 11ty
DanWebb Oct 2, 2024
13fb53b
refactor: reorganise styles
DanWebb Oct 2, 2024
60ded7e
feat: sitewide header
DanWebb Oct 2, 2024
cba140b
feat: basic hero
DanWebb Oct 2, 2024
fc7e8df
feat: separator
DanWebb Oct 2, 2024
2c856c6
feat: couple of homepage sections
DanWebb Oct 2, 2024
1d7030b
feat: placeholders for docs and about
DanWebb Oct 2, 2024
801ab77
feat: footer
DanWebb Oct 3, 2024
7e27a47
fix: active link not showing as active
DanWebb Oct 3, 2024
07a456f
feat: 4c tabs
DanWebb Oct 3, 2024
fa9da99
fix: content tab wrapping on mobile
DanWebb Oct 3, 2024
cc739ef
feat: last 2 homepage sections
DanWebb Oct 3, 2024
b7936d8
fix: d-alert escape
DanWebb Oct 3, 2024
fd38733
feat: finish off the about page content
DanWebb Oct 4, 2024
9ee3f5c
feat: docs pages
DanWebb Oct 4, 2024
7e26383
feat: animate the menu
DanWebb Oct 4, 2024
6e1386e
feat: iconz
DanWebb Oct 4, 2024
ec68208
fix: docs grid items overflowing into header
DanWebb Oct 4, 2024
e86de10
feat: view transition test
DanWebb Oct 4, 2024
4508a9f
feat: view transitions test 2
DanWebb Oct 4, 2024
a904fe2
revert: remove view transition names
DanWebb Oct 4, 2024
6bc0a4f
feat: animate separators when they move into the viewport
DanWebb Oct 4, 2024
b069892
feat: animations
DanWebb Oct 4, 2024
eb3cd2a
feat: fade docs pages
DanWebb Oct 4, 2024
030b23b
feat: refine expand line animation
DanWebb Oct 4, 2024
72ff84e
fix: umami recording views on dev
DanWebb Oct 7, 2024
f63a584
feat: refine fade animations
DanWebb Oct 7, 2024
7bbabe8
feat: content for the 4cs tabs
DanWebb Oct 7, 2024
647d381
feat: animate between tabs
DanWebb Oct 7, 2024
06a0107
feat: homepage content refinement
DanWebb Oct 7, 2024
e04fe69
fix: card overflowing alert
DanWebb Oct 7, 2024
cdd1464
feat: getting started content, docs nav
DanWebb Oct 7, 2024
0fa5e36
feat: the four cs documentation
DanWebb Oct 7, 2024
e7b5ad2
fix: img url path config
DanWebb Oct 7, 2024
8f593ce
feat: wordsmith
DanWebb Oct 7, 2024
f32488c
fix: docs overflow on mobile
DanWebb Oct 8, 2024
11f830b
feat: adjust the home hero fade for mobile
DanWebb Oct 8, 2024
906f98f
fix: bottom of separator diamond being cut off
DanWebb Oct 8, 2024
8f5e599
feat: apply the cs
DanWebb Oct 8, 2024
6dd36fe
feat: organisation and comparison docs
DanWebb Oct 8, 2024
f0f3ab8
feat: polishing organisation, images, 404
gavmck Oct 11, 2024
232c113
feat: code examples on the frontpage
gavmck Oct 11, 2024
6e6f8ab
feat: add the problem to the homepage
gavmck Oct 11, 2024
1559fac
feat: problem intro
gavmck Oct 11, 2024
4a5dd24
refactor: we can help
gavmck Oct 11, 2024
53ccd8a
chore: title tweak
gavmck Oct 11, 2024
9c8d0a1
refactor: polish from jim
gavmck Oct 14, 2024
768b2d0
feat: share cards
gavmck Oct 14, 2024
262da00
refactor: remove diff deleted styles
gavmck Oct 14, 2024
075e5c3
refactor: code always on right
gavmck Oct 14, 2024
dbd5384
fix: share card folder
gavmck Oct 14, 2024
de19bdd
fix: share card path
gavmck Oct 14, 2024
1d3d158
refactor: shuffle homepage around
gavmck Oct 14, 2024
42dc600
style: stylelint
DanWebb Oct 14, 2024
a63c1f2
fix: remove duplicate css properties
DanWebb Oct 14, 2024
745ef05
fix: correct lint staged glob
DanWebb Oct 14, 2024
d00f48c
refactor: docs to guide
gavmck Oct 14, 2024
45b198b
refactor: homepage polish
gavmck Oct 14, 2024
dccb3eb
refactor: about wordsmith
gavmck Oct 14, 2024
30c066a
refactor: tiny polish
gavmck Oct 14, 2024
d18490c
feat: add theme background
gavmck Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ jobs:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install -- lint-staged
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.1
20.12.2
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "explicit"
}
}
Empty file removed dist/.gitkeep
Empty file.
72 changes: 72 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
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') {
return content;
}

const targets = browserslistToTargets(browserslist('> 0.25% and not dead'));
const { code } = transform({
code: Buffer.from(content),
minify: true,
sourceMap: false,
targets,
});

return code;
}

export default function(eleventyConfig) {
// copy the assets folder to the output directory
eleventyConfig.addPassthroughCopy('src/assets');
// Reloading on css changes
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],
urlPath: '/assets/images/',
defaultAttributes: {
sizes: '100vw',
loading: 'lazy',
},
});
// load all components added to the src/components directory
eleventyConfig.addPlugin(webc, {
components: [
'src/components/**/*.webc',
'npm:@11ty/eleventy-img/*.webc',
],
bundlePluginOptions: {
transforms: [transformCSS],
},
});
// Support markdown templates in webc using <template webc:type="11ty" 11ty:type="md">
eleventyConfig.setLibrary('md', markdownIt({
html: true,
breaks: true,
linkify: true,
}));
// add syntax highlighting to code blocks
eleventyConfig.addPlugin(syntaxHighlight);

return {
dir: {
layouts: 'layouts',
includes: 'components',
data: 'data',
input: 'src',
output: 'dist'
}
}
};
9 changes: 9 additions & 0 deletions lib/findCollectionItem.js
Original file line number Diff line number Diff line change
@@ -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);
}
40 changes: 40 additions & 0 deletions lib/renderSvg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Image from '@11ty/eleventy-img';
import { optimize } from 'svgo';

function addAttributes(svgString, attributes) {
const attributesString = attributes
.map(({ name, value }) => `${name}="${value}"`)
.join(' ');

return svgString.replace('<svg', `<svg ${attributesString}`);
}

/**
* Get an SVG string from a file using @11ty/eleventy-img and compress it with svgo
*
* @param {String} path svg file to load, relative to the root directory
* @param {Array<{ name, value }>} attributes additional attributes to add to the SVG tag
*/
export default async function renderSvg(path, attributes = []) {
const metadata = await Image(path, {
formats: ['svg'],
dryRun: true, // Don’t write to the file system
});

const svgString = addAttributes(metadata.svg[0].buffer.toString(), attributes);

const result = optimize(svgString, {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
],
});

return result.data;
}
1 change: 1 addition & 0 deletions lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { '*.css': 'stylelint --fix' };
Loading