3
0
Fork
You've already forked websites
0
Monorepo for building all our websites and deploying them at statichost.eu
  • Nunjucks 61.7%
  • CSS 23.5%
  • JavaScript 14.8%
2026年07月12日 11:15:18 +02:00
_data Add PhilPapers link for the SEP article. 2026年04月13日 09:04:52 +02:00
_includes fix: Pad away from window edges. 2026年07月11日 20:04:26 +02:00
_js feat: Add the former sanity checks on the readings/archive lists. 2025年09月06日 12:18:08 +02:00
lab Promoted! 2026年07月11日 20:04:52 +02:00
personal Remove Athlinks, not using it anymore. 2026年07月12日 11:15:18 +02:00
products Add YSU media coverage. 2026年07月11日 20:04:59 +02:00
readings Add readings for Armenia course. 2026年04月13日 09:02:39 +02:00
.gitignore feat: Move CSS variable substitution into postcss. 2025年03月01日 18:36:35 +01:00
_redirects feat: Initial i18n setup, basic nav, starting on style. 2025年03月02日 12:21:37 +01:00
eleventy.config.js feat: Add favicon generation to all sites (base template). 2025年11月16日 23:46:40 +01:00
package-lock.json feat: Add favicon generation to all sites (base template). 2025年11月16日 23:46:40 +01:00
package.json feat: Add favicon generation to all sites (base template). 2025年11月16日 23:46:40 +01:00
postcss.config.js refactor: Clean up PostCSS config; remove all comments. 2025年03月03日 09:46:35 +01:00
prettier.config.js feat: Initial i18n setup, basic nav, starting on style. 2025年03月02日 12:21:37 +01:00
README.md docs: Add status badge. 2025年03月07日 21:13:11 +01:00

Pence Lab Websites

This is a monorepo that contains all of the code for our various websites. This file documents things that I thought were subtle enough that I could forget them at some point.

Lab:
Products:

Table of Contents

Data

Data that we process for the publication and talk lists are found in the _data folder. To add new things, copy the template from templates.json to the appropriate spot and customize it as needed.

Linting

Call npm run lint to run a variety of checks on the data in the _data folder. For the moment, this checks to make sure that the English and French translations are matching, and also verifies some important fields in the publications and talks data to be sure nothing is missing.

I18n

All these sites are designed for complete i18n from the ground up. Localized strings are found in _data/i18n.json and are exposed via a few shortcode functions added to Eleventy. We assume that every website directory will have en and fr directories underneath it.

To get translated pages working correctly, you need to:

  • Create directory data files that will set the lang attribute for all pages under them (e.g., fr/fr.json containing { "lang": "fr" })
  • Name the files according to their English URL names (e.g., en/about.md and fr/about.md)
  • Set the permalink in the French version of the page to a translated URL string (e.g., in fr/about.md, permalink: /fr/a-propos/index.html)

The translated strings support is only needed for things like navigation and templates, where a reusable piece of code has bits that need to be translated. Otherwise, prefer translating content directly in the different templates.

There is an automatic redirect set in all these sites from / to /en (i.e., the English version of the page will always be default).

Build Process

The sites are designed to be built by a git actions or CI workflow – at the moment, we’re using https://statichost.eu for our hosting. For the build system to know which of the sites is being built, the SITE_ROOT environment variable needs to be set, and will be passed to Eleventy’s --input parameter.

Put differently, there are no Eleventy templates in the root: multiple sites, with multiple roots, are found in sub-folders here.

Eleventy plugins are included for minifying and preprocessing CSS with PostCSS, as well as for minifying HTML with html-minifier-terser.