Skip to content

Commit 6e6c6a8

Browse files
authored
Add a better ignore script (GoogleChrome#5524)
* Migrate ignore feature from d.c.c. * Fix an issue with ignored codelabs. * Add better ignore script and readme update * gitignore eleventyignore
1 parent a56fd4e commit 6e6c6a8

File tree

9 files changed

+144
-29271
lines changed

9 files changed

+144
-29271
lines changed

.eleventyignore

-3
This file was deleted.

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,7 @@ entrypoint.hashmanifest.json
8585
.tmp
8686
.firebase
8787
firebase.json
88+
89+
# Eleventy
90+
# We generate our own .eleventyignore file dynamically during builds
91+
.eleventyignore

.huskyrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"//1": "Use git commit --no-verify to bypass the pre-commit hook",
33
"//2": "Use git push --no-verify to bypass the pre-push hook",
44
"hooks": {
5-
"pre-push": "npm run lint",
6-
"pre-commit": "node ./tools/isolate restored"
5+
"pre-push": "npm run lint"
76
}
87
}

README.md

+13-32
Original file line numberDiff line numberDiff line change
@@ -48,43 +48,24 @@ npm run dev
4848
Open `http://localhost:8080/` to see the site locally. Changes to assets will
4949
rebuild the site. Refresh to see your changes.
5050

51-
### Speeding up builds
51+
### Set up build flags
5252

53-
⚠️ This is an experimental feature 🧪🔬
53+
Building the entire site can take a while because it's around one thousand pages.
54+
If you want to _massively_ speed up your build times, we suggest setting some
55+
build flags to ignore certain sections.
5456

55-
Any change to the site will cause Eleventy to rebuild. This can take 10-20s. If
56-
you want to speed things up you can isolate your directory using the `isolate`
57-
command.
57+
- Create a `.env` file at the root of your project
58+
- Add the following:
5859

59-
```bash
60-
npm run isolate
61-
```
62-
63-
This will move all of the markdown files for the site into the `_exile`
64-
directory and it will ignore them for builds.
65-
66-
You may pass an optional glob (or space separated list of globs) to the
67-
`isolate` command to tell it to preserve a directory.
68-
69-
```bash
70-
# Example 1: Preserve the style-focus directory
71-
# note the -- which is needed to pass options to npm scripts
72-
npm run isolate -- src/site/content/en/accessible/style-focus/**
60+
```text
61+
# Ignore ALL site content
62+
ELEVENTY_IGNORE=true
7363
74-
# Example 2: Preserve everything in the accessible directory
75-
npm run isolate -- src/site/content/en/accessible/**/*
64+
# Only build the directories you're working on.
65+
# Note, this is a JSON string so you must use double quotes.
66+
ELEVENTY_INCLUDE=["blog", "vitals"]
7667
```
7768

78-
When you're finished making your edits, run the `integrate` command to restore
79-
all of the project files.
80-
81-
```bash
82-
npm run integrate
83-
```
84-
85-
☝️ A git commit hook will prevent you from being able to run `git commit` until
86-
you have run the `integrate` command.
87-
8869
## Environments 🌳
8970

9071
Set `ELEVENTY_ENV=prod` to force production builds. This is the default when
@@ -116,7 +97,7 @@ teams:
11697
- @GoogleChrome/web-devrel
11798

11899
1. Navigate to [the Deploy workflow in the Actions panel](https://github.com/GoogleChrome/web.dev/actions?query=workflow%3ADeploy).
119-
2. Click the **Run workflow** button. Make sure the branch says `master`, then click the green **Run workflow** button.
100+
2. Click the **Run workflow** button. Make sure the branch says `main`, then click the green **Run workflow** button.
120101

121102
![An expanded workflow popup with a green run workflow button inside of it.](https://user-images.githubusercontent.com/1066253/89584965-da6eb500-d7f1-11ea-8a43-d8b1abe2cd3b.png)
122103

0 commit comments

Comments
 (0)