A new version of the Tech Weeklies website.
https://techweeklies.futurice.com
Built with the Eleventy static site generator, and a good sprinkling of Javascript.
You'll need to have node and npm installed.
git clone https://github.com/futurice/techweeklies.futurice.com.git
cd techweeklies.futurice.com
npm installWe have a helper script to run you through it!
npm run make-postThe development pipeline sets up watchers for relevant files, and starts the build with eleventy.
npm run devnpm run buildThe production build is similar to development, but the pipeline is one-off and sequential.
We also do a few more things in production:
- Register a Service Worker
- Minify assets
- Set up long-term hashing of JS and CSS
- Postprocess the HTML to inline Critical CSS
npm run prodThis builds according to production and spins up a local server with similar properties to production. It is not 100% similar due to production being under a CDN, but important things such as hashing, inlining, Service Worker and compression are there.
You can append a DEBUG environment variable to get an output of Eleventy's internals. It works both in dev and build.
DEBUG=* npm run devA basic styleguide is available under /styleguide.
The page and the source can give you an impression of how components (Text, Link) and atoms (spacing, colours) are used in this system.
🚧 There's more to say in this section, working on it :) 🚧
The "site" per se lives under src.
Eleventy follows the directory structure, and provides metadata as well as collections to the templates.
The templating language is Nunjucks, but Eleventy supports other templates as well.
src/about/index.mdshows how to add a content page.src/posts/has the blog posts but really they can live in any directory. They need only theposttag to be added to this collection.- Add the
navtag to add a template to the top level site navigation. For example, this is in use onindex.njkandsrc/about/index.md. - Content can be any template format (blog posts needn’t be markdown, for example). Configure your supported templates in
.eleventy.js->templateFormats. - The blog post feed template is in
src/feed/feed.njk. This is also a good example of using a global data files in that it usessrc/_data/metadata.json. - This example uses three layouts:
src/_includes/layouts/base.njk: the top level HTML structuresrc/_includes/layouts/home.njk: the home page template (wrapped intobase.njk)src/_includes/layouts/post.njk: the blog post template (wrapped intobase.njk)
src/_includes/postlist.njkis a Nunjucks include and is a reusable component used to display a list of all the posts.src/index.njkhas an example of how to use it.- JS is handled by Rollup
- CSS is handled by a PostCSS pipeline
WIP
CSS is handled by a PostCSS pipeline
WIP
JS is handled by Rollup
WIP
WIP
WIP