This is the 11ty Front-end codebase for https://design-system.lib.umich.edu.
The drupal cms repository is here: https://github.com/mlibrary/design-system-cms
- Run the initialization script. (You are encouraged to read what's in it. There's nothing magical.) This will build the Docker image and install node modules.
./init.sh
-
Edit
.env
with real values. Ask a Design System developer for help. -
Starts the development server and watch changes in
.scss
and.js
files.
docker-compose up
- View in browser
http://localhost:8888
npm start
to start the eleventy server (serves the/public
folder) and watch the/scss
folder..scss
files compile and output to/public/css
.npm build
to create a production build. Outputs into/public
.
eleventy-sass
is used as a dev dependency to watch and compile the .scss
files and output to the /public/css
directory.
Eleventy Dev Server watches the /js
and /scss
folders and triggers a build when files in those folders are changed.
This is some very basic information. Please read the official 11ty documentation for an in-depth guide to building with 11ty.
src/_data/meta.json
This data can be used in the markdown and Nunjucks files. The following properties are supported:
Key | Description |
---|---|
siteName |
The full name of the website. |
productName |
Shortened name to describe the Design System. |
url |
Site url |
siteDescription |
Description of the site used for SEO. |
language |
Language set in the html for the site. |
author |
Creator of the site. An object with author's name , url , and email . |
Layouts use the Nunjucks templating language.
Page layouts are located the the layouts
folder.
src/_includes/layouts
There is a base.njk
file for the HTML boilerplate.
Additional layouts build off of that boilerplate.
/layouts
base.njk
home.njk
landing-page.njk
page.njk
Partials use the Nunjucks {% include %}
and are located in the partials
folder.
src/_includes/partials
Static page content is created with markdown (.md). Use YAML front matter to add data to your content. Locally assigned front matter values override things further up the chain.
Pages are generated from the Drupal content coming from the Drupal JSON:API using the 11ty pagination feature.
src/_data/drupal.js
There are two Nunjuck files- one to generate a page (page-generator.njk
) and
one to generate landing pages (landing_page-generator.njk
).
Edit the styles in the src/scss
folder. 11ty is watching that folder. 11ty then passes through the compressed CSS to the
public
folder.
Add images to the src/img
folder. 11ty is watching that folder and passing
through the files to the public
folder.
This site uses the 11ty Navigation Plugin. This plugin supports infinite-depth hierarchical navigation and breadcrumbs.
Add the eleventyNavigation
object to your front matter data (or in a data
directory file). Assign a unique string to the key property inside of
eleventyNavigation
.
eleventyNavigation:
key: about
Collections allow you to group data in certain ways using tags
.
Important distinction: tags have a singular purpose in Eleventy... to construct collections of content. Not to be confused with tag labels used in blogs.
Please visit the official 11ty docs.
These were helpful for data configuration: