Personal boilerplate for Eleventy projects
Heavier-lift techniques that may not be appropriate for every project, but can be referenced from another project:
Technique | Project with example |
---|---|
Netlify comment forms | World Snacks |
Paginating tagged items | Personal website |
Webmentions | Personal website |
- Update
package.json
,_data/site.json
, andfeed.njk
with project details - If not using posts: delete
feed.njk
, RSS code ineleventy.js
, post and pagination bits in_includes
- Go thru
eleventy.js
and un-comment or delete utilities - Update or remove
icon-sprite.njk
- Update
head.njk
with any info for: RSS, social metadata, icons - Update images referenced in
manifest.webmanifest
- Install Node :)
- Clone the repo
- Run
npm install
- Run
npm run start
- Visit
localhost:8080
Command | Purpose |
---|---|
npm run start |
Serve project + watch Sass |
npm run build |
Build project |
npm run checks |
Validate HTML & lint JS |
npm run lint |
Run eslint |
npm run lint:fix |
Run eslint and fix issues |
npm run validate |
Run html-validate |
---
title:
date: 2021-##-##
tags: ["posts", "foo", "bar"]
featureSrc: (Omit "-m", which is added automatically)
featureExt:
featureAlt:
---
Size | PX width |
---|---|
s | 600 |
m | 800 |
l | 1200 |
xl | 2000 |
Filename, extension, max size, alt text, classes:
{% responsiveImage "melanierichards-", "jpg", "xl", "Alt", "" %}
- Max size can be
l
orxl
- Classes can include
c-media--limit-width
<svg role="image" focusable="false" class="c-rating" viewBox="0 0 20 20" width="20" height="20" xmlns="http://www.w3.org/2000/svg">
<title>Accessible label</title>
<use href="#" y="-20">
</svg>