How aaronmclayton/11ty-starter-kit works
This project is a starter kit for 11ty (Eleventy), a static site generator, that leverages Nunjucks as its templating engine and TailwindCSS for styling. The main goal of the project is to provide developers with a pre-configured, minimal starting point for building fast, static websites with a modern CSS framework and templating support.
Main Components
• 11ty Engine: Representing the static site generation process, which reads configuration from .eleventy.js.
• Template Engine (Nunjucks): Indicated by the directory src/_includes and layouts (e.g., base.html) where all the templating logic resides.
• CSS Processing (TailwindCSS): With configuration via tailwind.config.js and styles in src/css/main.css.
• Static Assets: The src folder (e.g., src/index.html) which houses the static HTML files that are pre-processed by 11ty.
• Build & Development Tools: Node.js environment with dependency definitions (package.json and package-lock.json) that coordinate the build, watch, and serve commands.
File Structure for Additional Details
• Top-level files like .eleventy.js and tailwind.config.js point to configuration and build-time processing logic.
• The inclusion of LICENSE, README.md, and package JSON files indicate standard project documentation and dependency management.
• The src directory is logically partitioned into segments for layouts (src/_includes/layouts) and styling (src/css), signaling a separation of concerns between content/templates and design.
Relationships and Interactions
• 11ty reads the content and templates from the src folder (including layouts in src/_includes) and processes them according to instructions set in .eleventy.js to generate static HTML files.
• TailwindCSS is integrated into the build pipeline; changes in src/css/main.css trigger a recompilation through Tailwind (as per tailwind.config.js) which in turn auto-refreshes the content served.
• The NPM scripts (npm run start) orchestrate the development flow, ensuring that 11ty and Tailwind play together to watch file changes and update the build accordingly.
Architectural Patterns & Technologies
• The project follows a static site architecture with clear separation of content (HTML and templates), presentation (CSS/Tailwind), and build configuration.
• It utilizes convention-over-configuration where file naming and directory layout drive the static site generation process.
• There’s an emphasis on automation and watch-based reloading during development, as described in the README.
• "User Content" (src directory) into logical subgroups: Templates, Layouts, and CSS.
• Role of configuration files (e.g., .eleventy.js for 11ty and tailwind.config.js for Tailwind) that customize the build process.
• Element is clearly labeled and interactions are unambiguous, facilitating a quick understanding of how the starter kit functions as a whole.