Among other things, here are some important directories and files at the root of the repo:
eleventy.config.js
src
public
_data
_config
_includes
eleventy.config
is kept at the root of the project. It is the main configuration file of an Eleventy project. It defines which directories are made public, which are used for input and output data.
The src
directory at the root of the project is defined as the main input directory. All pages that are built are kept in it or in one of its subdirectories.
Nav-related:
src/about.njk
src/blogroll.njk
: paginates data in_data/blogrollData.js
as one final pagesrc/colophon.njk
src/index.njk
: homepagesrc/media.njk
src/now.njk
src/posts.njk
src/recipes.njk
: paginates links to individual recipe postssrc/uses.njk
Other special cases:
src/search.njk
: fallback search page used if the user disabled Javascriptsrc/search-index.njk
: template creating the search index JSON filesrc/feed.njk
: template creating the RSS feed/feed.xml
src/media
: includes all media posts that are linked inclarale.com/media/
src/posts
: includes all blog posts that are linked inclarale.com/posts/
src/recipes
: includes all recipe posts that are linked inclarale.com/recipes/
. The original files are in JSON. They are read by_data/recipeData.js
and paginated through thesrc/recipes/recipe-layout.njk
template.
The public
directory is published as-is and can be accessed from the client.
public/img
: stores all imagespublic/styles
: stores all CSS files
_data
: stores global data files that we can access from anywhere in the project_config
: stores custom-made filters and plugins used in the project
The _includes
directory stores everything that is template-related. It contains regular NJK files that can be injected in pages and templates. It also has two subdirectories of more specialized template-files:
layout
: a layout is a template that wraps other content. This website uses two different layouts:_includes/layout/base.njk
: The top level HTML structure that wraps all pages._includes/layout/post.njk
: The post template (wrapped inside ofbase.njk
). It is used for generic posts with apost-header.njk
at the top, footnotes support and a comment section at the bottom.
macro
: a macro is a snippet that can be injected in a page or template, its content can be defined when injecting it