This repository contains the source code for the Dekker Lab website.
These instructions will guide you on how to set up and run the website locally.
- Node.js (version 18 or later recommended): typically called
nodejsin popular package managers. Ensurenpm(Node Package Manager) is installed with Node.js.
-
Clone the repository:
git clone git@github.com:dekkerlab/labsite.git cd your-repository-nameReplace
git@github.com:dekkerlab/labsite.gitwith the URL of your Git repository. -
Install dependencies:
npm install
This command installs all the necessary packages listed in the
package.jsonfile, including 11ty and any plugins (like@11ty/eleventy-plugin-datesandjs-yaml). The fate of thepackage.lock.jsonis less clear to me (to be figured out)...
-
Build the static site:
npx @11ty/eleventy
This command will generate the static website files in the
_sitedirectory. -
Serve the website locally (with live reloading):
npx @11ty/eleventy --serve
This command will build the site and start a local development server, usually accessible at
http://localhost:8080. Any changes you make to the source files will automatically trigger a rebuild and refresh in your browser. Except some of the JS-related changes require a full server restart to take effect !
- Eleventy (@11ty/eleventy): The static site generator used to build the website.
- js-yaml: Used for parsing YAML data files (e.g.,
_data/members.yaml). - @11ty/eleventy-plugin-dates (optional): Provides date formatting filters in Nunjucks templates.
The copyright year in the website's footer is currently generated at build time using JavaScript in the Eleventy configuration. To update the copyright year for a new year, you will need to:
- Open the
_data/site.jsfile. - Locate the
getCurrentYear()function. - Re-run the Eleventy build process using either
npm run build(or the direct Eleventy commands mentioned above) in the terminal after the year has changed. - Deploy the newly generated
_sitedirectory to your web hosting provider.
Note: For automatic year updates without manual rebuilding, the website uses client-side JavaScript in the _includes/layouts/base.njk file. Ensure this script remains in place for the year to update dynamically in users' browsers.
gemini 2.0 was heavily involved in the website generation