Skip to content

Commit 0db8fe7

Browse files
committed
content updates
1 parent 0096f3a commit 0db8fe7

14 files changed

+137
-14
lines changed

src/site/_includes/css/main.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ h1 {
3535
line-height: 0.9;
3636
margin: 0 0 3rem 0;
3737
}
38+
p {
39+
margin: 0 0 1rem 0;
40+
}
41+
a {
42+
color: #f79a44;
43+
&:hover {
44+
color: #ffc793;
45+
}
46+
}
3847

3948
.button {
4049
background: white;

src/site/content/1-process-html.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,14 @@
22
title: Process HTML
33
---
44

5-
By processing HTML, I mean turning templates, layouts, partials, and data into flat (probably minified) HTML. You’ll need to do this processing in development to work on your site, but you don’t need to commit the processed HTML to your repo. The build process can produce it there with different options, like you could minifiy HTML in production but not in development.
5+
It's likely you'll need some kind of HTML processing to turn templates, layouts, partials, and data into full HTML documents you can use.
6+
7+
### Principles
8+
9+
- Commit only authored files in the repo
10+
- Minify production HTML
11+
12+
### Relevant Tools
13+
14+
- With [Static Site Generators](https://serverless.css-tricks.com/services/ssgs) like [Eleventy](https://www.11ty.dev/), [Jekyll](https://jekyllrb.com/), and [Hugo](https://gohugo.io/) you handle this rather directly.
15+
- With JavaScript Framework Site Generators like [Gatsby](https://www.gatsbyjs.org/), [Next](https://nextjs.org/), [Nuxt](https://nuxtjs.org/), [VuePress](https://vuepress.vuejs.org/), and [Gridsome](https://gridsome.org/), the HTML is created as part of piecing together components.

src/site/content/10-sitemap.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,15 @@
22
title: Build a sitemap
33
---
44

5-
Check for broken links too?
5+
If your site is large/complex (over 500 pages), search engines like Google [suggest](https://support.google.com/webmasters/answer/156184?hl=en) a sitemap so they can more intelligently crawl your site.
6+
7+
### Principals
8+
9+
- Produce site map files only for production
10+
- Aren't there different kinds like video site maps?
11+
- Is this a good time to look for broken links? Probably takes a while? Run on a CRON or async against master?
12+
13+
### Relevant Tools
14+
15+
- Something that makes site maps
16+
- [broken-link-checker](https://www.npmjs.com/package/broken-link-checker)

src/site/content/11-notify.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@
22
title: Send Notifications
33
---
44

5-
Slack, SMS, Email, etc.
5+
### Principals
6+
7+
- When important things happen in a build process, notify the right people.
8+
9+
### Relevant Tools
10+
11+
- Slack, Discord
12+
- Email sending APIs like Sparkpost, Mailgun, etc.
13+
- SMS sending APIs like Twilio

src/site/content/2-process-css.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22
title: Process CSS
33
---
44

5+
It's likely you'll use some kind of CSS processing on a site.
6+
57
You likely need to process your CSS as you develop. This site will assume a Sass setup, but it could be all PostCSS, or Stylus and Autoprefixer, Tailwind and PurgeCSS and cssnano, etc.
68

79
The main point is to not commit the processed/minified files to the repo. They are useless there, creating noisy commits.
10+
11+
### Principles
12+
13+
- Lint & Prettify authored files
14+
- Commit only authored files to repo
15+
- Concatenate & minify production CSS
16+
- Create sourcemaps
17+
18+
### Relevant Tools
19+
20+
- Lint with Stylelint
21+
- Prettify with Prettier
22+
- Preprocessors like Sass, Less, and Stylus.
23+
- Preprocessors meant to run last, like PostCSS/Autoprefixer
24+
- Minifiers like [cssnano](https://cssnano.co/), [clean-css](https://www.npmjs.com/package/clean-css), [uglifycss](https://www.npmjs.com/package/uglifycss), [csso](https://github.com/css/csso), or [node-minify](https://www.npmjs.com/package/node-minify).
25+
- [Unused CSS](https://css-tricks.com/how-do-you-remove-unused-css-from-a-site/) tools like [PurgeCSS](https://purgecss.com/), [PurifyCSS](https://github.com/purifycss/purifycss)

src/site/content/3-process.js.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@
22
title: Process JavaScript
33
---
44

5-
Babel. webpack?
5+
You may want to preprocess your JavaScript, allowing for use of modern features that may not be supported in as many browsers as you'd like to support. But you may also want to split up your authored JavaScript for readability.
6+
7+
### Principals
8+
9+
- Only commit authored files to Repo
10+
- Sourcemaps
11+
- Concatenate & minify production JavaScript
12+
- Code splitting & tree shaking
13+
14+
### Relevant Tools
15+
16+
- Babel
17+
- Bundlers like [Rollup](https://github.com/rollup/rollup), [Parcel](https://parceljs.org/), and [webpack](https://webpack.js.org/).
18+
- Post-install one-time package usage with [Snowpack](https://www.snowpack.dev/).

src/site/content/4-optimize-images.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
title: Optimize Images
33
---
44

5-
PNG, JPEG, GIF
5+
### Principals
66

7-
SVG
7+
- Keep highest quality images around (but probably not in repo itself)
8+
- Optimize every single production image
9+
- Use responsive image and lazy load syntax in production HTML
10+
- Serve the best image formats that are supported (e.g. create and serve .webp when possible)
11+
- Use muted, autoplaying, looping `<video>` instead of GIFs
812

9-
Make Webps?
13+
### Relevant Tools
1014

11-
Help with responsive images?
15+
- [sharp](https://github.com/lovell/sharp) or [imagemin](https://github.com/imagemin/imagemin) for raster images
16+
- [svgo](https://github.com/svg/svgo) for .svg
17+
- APIs like [Imgix](https://docs.imgix.com/apis/url), or [ImageOptim](https://imageoptim.com/api)
18+
- [Cloudinary](https://cloudinary.com/) to host and serve optimized images

src/site/content/5-unit-tests.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
---
22
title: Run Unit Tests
33
---
4+
5+
Make sure your JavaScript is doing what you wrote it to do, by writing unit tests and making sure those tests pass.
6+
7+
### Principals
8+
9+
- Run your unit tests on every commit
10+
11+
### Relevant Tools
12+
13+
- Jest

src/site/content/6-end-to-end.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,13 @@
22
title: Run End-to-End Tests
33
---
44

5-
Cypress
5+
Make sure your website is doing all the important things it should be doing. End-to-end tests are great for testing whole usage flows like visiting a URL, clicking a button, and making sure a certain modal is open with the correct text in it. Or going through a sign up process.
6+
7+
### Principals
8+
9+
- Run your end-to-end tests on every commit
10+
11+
### Relevant Tools
12+
13+
- Cypress
14+
- jest-puppeteer

src/site/content/7-a11y-tests.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
---
22
title: Run Accessibility Tests
33
---
4+
5+
You should prevent yourself from shipping any easily preventable and detectable accessibility problems by running automated accessibility testing tools.
6+
7+
### Principals
8+
9+
- Run your accessibility tests on every commit
10+
11+
### Relevant Tools
12+
13+
- [pA11y](https://github.com/pa11y/pa11y)
14+
- [Axe](https://github.com/dequelabs/axe-cli)

src/site/content/8-visual-regression.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@
22
title: Run Visual Regression Tests
33
---
44

5-
Percy?
5+
Prevent yourself from making unwanted visual changes to a site by comparing screenshots and ensuring that the changes you made are the changes you want.
6+
7+
### Principals
8+
9+
- Run your visual regression tests on pull requests coming into Master.
10+
11+
### Relevant Tools
12+
13+
- [Percy](https://percy.io/)

src/site/content/9-perf-budget.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
---
22
title: Test Against Performance Budget
33
---
4+
5+
Make sure your website doesn't regress in performance by testing all changes against your established performance budget.
6+
7+
### Principals
8+
9+
- Run your performance tests on every commit.
10+
11+
### Relevant Tools
12+
13+
- Hosted services like [SpeedCurve](https://speedcurve.com/) ([CLI](https://github.com/SpeedCurve-Metrics/speedcurve-cli)) and [Calibre](https://calibreapp.com/) ([CLI](https://calibreapp.com/cli))

src/site/css/.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Ignore everything in this directory
2-
*
3-
# Except this file
1+
# Ignore everything in this directory, except this file
2+
# It's here because the folder needs to exist for Netlify
43
!.gitignore

src/site/index.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ layout: default
1111
<span>could & should do.</span>
1212
</h1>
1313

14-
<p class="intro-p">This site is about all the things you can and often should do with a build process on a site. That is, your local build process, but more importantly the build process that runs after you commit your code. They need to work in unison so that your repo is clear of files that dont need to be there and youre making computers help you do rote tasks for you and protect you from yourself.</p>
14+
<p class="intro-p">This site is about all the things you can and often should do with a build process on a site. To some degree, your <em>local</em> build process, but this is more about the build process that runs <em>as you commit code and deploy</em>. They need to work in unison so that your repo is clear of files that don't need to be there, you're being protected from mistakes, and you're making computers do things they are best at.</p>
1515

1616
<a class="button repo-button" href="https://github.com/CSS-Tricks/build-process">Repo on GitHub</a>
1717
</header>

0 commit comments

Comments
 (0)