How codestitchofficial/intermediate-website-kit-less works
Project Type & Purpose
• This is a static website starter kit that leverages the Eleventy static site generator with Nunjucks templating.
• It integrates Decap CMS for client-friendly content management (primarily for blogging) and uses LESS for pre-processing styles.
• It is designed to serve as a full-fledged, yet static, front-end project that is ready for rapid deployment (especially to Netlify).
Analysis of the File Structure
• Root Files:
– Files like .eleventy.js (Eleventy configuration), netlify.toml (deployment configurations specific to Netlify), package.json/package-lock.json (manage NodeJS dependencies and scripts), and LICENSE/README.
• src/ Directory:
– _data: Contains global data (client.js) that feeds information (like client contact details) into templating.
– _includes: Divided into components (reusable UI parts: header, footer, CTAs) and layouts (base HTML structure and blog post layout).
– admin: Contains Decap CMS configuration files (config.yml and index.html) to support CMS workflows for blog posts.
– assets: Organized sub-folders for CSS (processed from LESS), favicons, fonts, images, JavaScript (bundled with esbuild), LESS preprocessor files, and SVGs.
– config: Holds additional configuration files (plugin settings, filters, etc.) needed by Eleventy.
– content: Divided into blog (markdown files and JSON data for blog posts) and pages (static pages including about, contact, projects, etc.) that get built into the final site.
– Root files like index.html, robots.html, and sitemap.html act as entry points for the generated site.
• Tools & Technologies:
– Eleventy as the core static site generator.
– Nunjucks for template inheritance and dynamic page generation.
– Decap CMS configured in the admin folder.
– esbuild for JavaScript bundling and minification.
– Netlify configuration (netlify.toml) for deployment along with automatic sitemap and asset passthrough.
– LESS pre-processing to create CSS from LESS files.
Main Components
a. Build/Compilation Layer:
– Preprocessors: LESS files compiled into CSS; JavaScript bundling (using esbuild/minification).
– Plugins: Eleventy Navigation, Sitemap generation, and HTML/CSS minifiers.
b. Content & Data Layer:
– Global Data (src/_data/client.js) which provides client-specific configuration.
– Content Files: Markdown and JSON files under content/blog and content/pages that supply dynamic content.
c. Presentation Layer:
– Templates & Layouts (src/_includes/layouts and components) that structure the HTML pages.
– Root index.html and other HTML templates (robots.html, sitemap.html) that are built using the layouts.
d. CMS Integration:
e. Asset Delivery:
– Assets Folder (src/assets): Contains CSS, JavaScript, images, fonts, and favicons that are directly passed through to public/.
f. Deployment & Hosting:
– Netlify (as represented by netlify.toml and public/ output folder) which hosts the processed site and handles redirects as defined in _redirects file.
– Build Environment: NPM scripts (npm start “watch:eleventy” and npm run build “build:eleventy”) that control development and production modes.
Relationships & Interactions
• How global data (from src/_data/client.js) and configuration files feed into final HTML generation via templates.
• Two-way relationship between the Decap CMS and the content/blog directory (client creates content in the CMS, which writes markdown files, triggering a new build).
• Deployment pipelines – from local development (npm scripts) to the final hosted site where users interact with static content.
Architectural Patterns & Design Principles
• Modular and component-based design via reusable templates, components, and layouts.
• Clear separation between content (markdown and data files) and presentation (HTML templates/Less).
• Infrastructure-as-code approach for deployment – configuration via netlify.toml.
• Use of global data files to centralize client-specific information.
• Build-time pre-processing which decouples source files from production-ready assets.
Essential Elements
• Use annotations, if necessary, to mention major plugins (Eleventy Navigation, Sitemap, HTML/CSS minifiers) and pre-processors (LESS, esbuild).