This is the codebase for Open Web Docs built upon the 11ty framework.
Clone the repository, then run npm i
to install the dev dependencies.
Once you've performed the setup, you can run this codebase locally by running npm run serve
in your terminal. This will serve the site to localhost:8081
. The site will automatically rebuild and reload the browser page when modifications are detected.
If you want to perform a simple build of the site, you can run npm run build
. This will build the site and output the files to the _site
folder.
adds the img
directory to _site
so that it can be output to the browser.
If you want to include a new directory that you want outputted to the browser, you'll need to add it to the list of dircetories in .eleventy.js
; for example:
// Copy `img/` to `_site/img`
eleventyConfig.addPassthroughCopy("img");
There are some things to be aware of when making changes.
- The
theme.css
includes rules forprefers-color-scheme("dark")
andbody.dark
which are exactly the same this is so that folks can use dark mode regardless of their system preferences. If you make changes to one, ensure you make changes to the other.- If you're making changes to dark mode ensure that you're prefacing all new rules with
body.dark
andbody.systemDarkPreference
respectively.
- If you're making changes to dark mode ensure that you're prefacing all new rules with
- For collections (posts, reports, worklog), there is an accomponying json file which includes global rules for the files that live in the related directory; for example:
This is setting the layout for all posts and ensures that each post has the tag
{ "layout": "layouts/post.njk", "tags": [ "post" ] }
post
so that all posts can be included in the posts collection. - If you create a file that you don't want included in a collection, include
eleventyExcludeFromCollections: true
in the front-matter.