11ty project for my website.
Based on eleventy-sample.
npm install
npm run dev
npm run build
npm run lint
npm run check:types
Run build
first.
npm run check:links
This project uses iconism to strip down fontawesomes big icon library.
It runs automatically with the eleventy build, but you can also call it manually:
npm run generate:font
Tool for checking the file:
ttx -t cmap -o - ./_site/styles/icons/icons.ttf
ttx -t cmap -o - ./node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.ttf
font-manager ./_site/styles/icons/icons.ttf
Find codepoint by name:
Open ./node_modules/@fortawesome/fontawesome-free/scss/_variables.scss
and search for the name of the icon, for example for copy:
$fa-var-copy: \f0c5;
Then, add an entry to ./icon-font.json
:
{
"name": "copy",
"unicode": "\uf0c5",
"path": "./node_modules/@fortawesome/fontawesome-free/svgs/solid/copy.svg"
}
Last, use your icon in the HTML:
<i class="icon icon-copy"></i>
To add a navigation page, add a front matter key navigationWeight
to the page.
It will automatically show up in the navigation.
The navigation is sorted by the weights.
Linting and type checking is also done by the npm package pre-commit
.
It does this checks when a git commit is triggered.
You can bypass the checks by passing --no-verify
to git commit.
See here.
git remote add base git@github.com:andreas-mausch/eleventy-sample.git
git remote -v
git fetch base
git branch -a
git merge base/main