|
8 | 8 | ## How it works |
9 | 9 |
|
10 | 10 | - the contents of each page are stored in [yaml](https://yaml.org/) format in [src/content](/src/content) |
11 | | -- there is a corresponding [pug](https://pugjs.org/) HTML template for each page in [src/pug](/src/pug) |
| 11 | +- there is a corresponding [Nunjucks](https://mozilla.github.io/nunjucks/) HTML template for each page in [src/pages](/src/pages) |
12 | 12 | - uses CSS and icons from the [Bootstrap](https://getbootstrap.com/) framework |
13 | 13 | - uses [pnpm](https://pnpm.io/) and [webpack](https://webpack.js.org/) to manage the build and dependencies |
| 14 | +- uses [Eleventy](https://www.11ty.dev/) as the static site generator |
14 | 15 |
|
15 | 16 | ## Structure |
16 | 17 |
|
17 | 18 | - [src/content](/src/content) |
18 | 19 | - each page has a yaml file with the content for that page |
19 | | - - this data is made available as `content` to the pug template of the same name |
20 | | -- [src/pug](/src/pug) |
21 | | - - each page has a [pug](https://pugjs.org/) template |
| 20 | + - this data is made available to the Nunjucks template of the same name |
| 21 | +- [src/pages](/src/pages) |
| 22 | + - each page has a [Nunjucks](https://mozilla.github.io/nunjucks/) template (`.njk`) |
22 | 23 | - the html page is generated from this template |
23 | | - - it inherits the base layout from [src/pug/layouts/base.pug](/src/pug/layouts/base.pug) |
24 | | - - it can use functions ('mixins') from [src/pug/mixins](/src/pug/mixins) |
| 24 | + - it inherits the base layout from [src/pages/\_includes/layouts/base.njk](/src/pages/_includes/layouts/base.njk) |
| 25 | + - it can use functions ('macros') from [src/pages/\_includes/macros](/src/pages/_includes/macros) |
25 | 26 | - [src/assets](/src/assets) |
26 | 27 | - contains the image and video files |
27 | | -- [src/scss](/src/scss) |
28 | | - - import and customize [Bootstrap css](https://getbootstrap.com/docs/5.3/customize/sass/) |
| 28 | +- [src/css](/src/css) |
| 29 | + - custom CSS styles |
29 | 30 | - [src/js](/src/js) |
30 | 31 | - additional client-side javascript |
31 | 32 | - [src/index.js](/src/index.js) |
@@ -58,8 +59,9 @@ On every commit to the main branch: |
58 | 59 |
|
59 | 60 | To add a page `X`: |
60 | 61 |
|
61 | | -- create a text file `src/pug/X.pug` with the contents `extends layouts/base` |
62 | 62 | - create a text file `src/content/X.yml` with the contents `page_title: "X"` |
| 63 | +- create a text file `src/pages/X.njk` that extends the base layout |
| 64 | +- create a text file `src/pages/X.11tydata.js` with the contents `module.exports = require("./_helpers/loadContent")("X.yml");` |
63 | 65 | - add an entry for it to the list of pages in [src/content/navbar.yml](src/content/navbar.yml) |
64 | 66 |
|
65 | 67 | ## Acknowledgements |
|
0 commit comments