|
1 | | -# web-features explorer |
| 1 | +# Web platform features explorer |
2 | 2 |
|
3 | | -A website to visualize the web platform data that's maintained in the [web-platform-dx/web-features](https://github.com/web-platform-dx/web-features/) repository in interesting ways, including a monthly release note. |
| 3 | +The web platform features explorer website visualizes the web platform data that's maintained in the [web-platform-dx/web-features](https://github.com/web-platform-dx/web-features/) repository. |
4 | 4 |
|
5 | | -The website: https://web-platform-dx.github.io/web-features-explorer/ |
| 5 | +View the live website at https://web-platform-dx.github.io/web-features-explorer/. |
6 | 6 |
|
7 | | -## Goal |
| 7 | +## Goals of the website |
8 | 8 |
|
9 | | -* To visualize the web-features data. |
10 | | -* To provide a way to explore the data in user-friendly ways, such as: |
11 | | - * By [baseline-low features](https://web-platform-dx.github.io/web-features-explorer/recent/) (newly available on the web platform). |
12 | | - * By [baseline-high features](https://web-platform-dx.github.io/web-features-explorer/baseline/) (widely available on the web platform). |
13 | | - * By [monthly release notes](https://web-platform-dx.github.io/web-features-explorer/monthly/). |
14 | | - * Or, by features that are [not yet available](https://web-platform-dx.github.io/web-features-explorer/nobaseline/) on the web platform. |
15 | | -* To test various use cases that consumers of this data have. |
16 | | -* To detect issues in the data. |
| 9 | +* To test and visualize the data that's in the web-features repo. |
| 10 | +* To connect the data to other relevant sources of information about web features. |
| 11 | +* To provide web developers with useful ways to stay up to date with the web and explore features. |
17 | 12 |
|
18 | 13 | ## Architecture |
19 | 14 |
|
20 | 15 | ### Data |
21 | 16 |
|
22 | | -The data that the website is based on comes from the [web-features](https://www.npmjs.com/package/web-features) npm package, by using its **next** version (which always provide the data from the latest commit on the web-features repo). |
| 17 | +The data that the website is based on comes from the [web-features](https://www.npmjs.com/package/web-features) NPM package. The site uses the **next** version if the package, which provide the data from the latest commit on the web-features repo. |
23 | 18 |
|
24 | | -In addition, the [@mdn/browser-compat-data](https://www.npmjs.com/package/browser-compat-data) npm package is used to get various other pieces of information, such as links to MDN documentation and links to bug trackers. |
| 19 | +In addition, the site uses the [@mdn/browser-compat-data](https://www.npmjs.com/package/browser-compat-data) NPM package to get various other pieces of information, such as links to MDN documentation and links to bug trackers. |
| 20 | + |
| 21 | +### Pages |
| 22 | + |
| 23 | +The web pages are built by using the [Eleventy static site generator](https://www.11ty.dev/). |
| 24 | + |
| 25 | +## Local development |
| 26 | + |
| 27 | +To run the website locally, clone the repository, make sure the dependencies are updated, and then build the site. |
| 28 | + |
| 29 | +### Update the dependencies |
25 | 30 |
|
26 | 31 | To ensure you have the latest data: |
27 | 32 |
|
28 | 33 | 1. Run `npx npm-check-updates -u` |
29 | 34 |
|
30 | 35 | 1. Run `npm update web-features` |
31 | 36 |
|
32 | | -### Build |
| 37 | +1. `npm install` |
33 | 38 |
|
34 | | -The website consists of static HTML pages and uses a build script to generate those HTML pages from the data. |
| 39 | +### Build the site |
35 | 40 |
|
36 | | -The template files, from which the static HTML pages get generated, use the [11ty](https://www.11ty.dev/) static website generator. The template files are found in the `site` directory. |
| 41 | +To build the site: |
37 | 42 |
|
38 | | -The result of the build script is found in the `docs` directory, which is the directory that GitHub Pages uses to serve the website (see [Deployment](#deployment)). |
| 43 | +1. Run `npm run build` to generate the site |
39 | 44 |
|
40 | | -To re-generate the website, after updating the data: |
| 45 | +1. Check the `docs` folder for the resulting build files. |
41 | 46 |
|
42 | | -1. Run `npm install` |
| 47 | +The source template files used to build the site are in the `site` folder. |
43 | 48 |
|
44 | | -1. Run `npm run build` to generate the site |
45 | | - |
46 | | - You can also run `npm run serve` to start a local server and watch for changes |
| 49 | +### Run and edit the site locally |
| 50 | + |
| 51 | +To run the website on a local development server: |
47 | 52 |
|
48 | | -### Deployment |
| 53 | +1. Run `npm run serve`. |
49 | 54 |
|
50 | | -The website is deployed to production using [GitHub Pages](https://pages.github.com/). |
| 55 | +1. Open a web browser and go to `http://localhost:8080`. |
51 | 56 |
|
52 | | -The static HTML pages are generated on the [gh-pages branch](https://github.com/web-platform-dx/web-features-explorer/tree/gh-pages). |
| 57 | +1. Modify a source file, wait for the build to run automatically, and for the changes to appear in the browser. |
| 58 | + |
| 59 | +The result of the build script is found in the `docs` directory, which is the directory that GitHub Pages uses to serve the website (see [Deployment](#deployment)). |
53 | 60 |
|
54 | | -### Automatic updates |
| 61 | +## Production environment |
55 | 62 |
|
56 | | -The website is automatically updated on every push to the main branch by using a GitHub Actions script found in `.github/workflows/generate-site.yaml`. |
| 63 | +The website is deployed to production using [GitHub Pages](https://pages.github.com/). The static HTML pages are generated in the [gh-pages branch](https://github.com/web-platform-dx/web-features-explorer/tree/gh-pages) on a regular basis by the GitHub Actions script found in `.github/workflows/generate-site.yaml`. |
57 | 64 |
|
58 | 65 | The dependencies are also automatically updated every day by using the GitHub Actions script in `.github/workflows/bump-deps.yaml`. |
0 commit comments