How donini/labrador-jekyll-theme works
Main Components
• Configuration & Data: At the core you have the _config.yml, the .htaccess file (for redirect or URL rewriting), and the _data folder containing language files (in JSON) and social links. These provide global settings and content-specific data.
• Content Sources: The markdown files (blog.md, en.md, pt.md) in the project root alongside blog post markdown files under the _posts folder serve as the sources of content. These files hold the front matter needed for Jekyll builds, like layout selections and metadata.
• Template Components: The _includes folder is split into “general” components (header, footer, menu, language switcher, social links, and blog-specific elements) and “sections” (blocks for distinct parts of the front page like profile sections). Additionally, the _layouts folder contains different HTML templates (default, blog, page, post) that determine how pages are rendered.
• Assets: The assets folder holds CSS (with SASS stylesheets, blog-specific CSS, and a normalize.css file), fonts, images, and JavaScript. These ensure the visual representation, layout styling, and interactive behavior of the generated site.
• Media: A dedicated media directory is available for storing resources, particularly for blog posts (e.g., featured images).
Relationships and Interactions
• The _config.yml file directs the behavior of the Jekyll build, feeding into how posts, pages, and layouts link together.
• Content files in _posts and root-level language markdown files use front matter to specify which _layout to use and reference _includes partials, allowing dynamic assembly of pages.
• The _data directory’s JSON files are consumed by the Liquid templating system within the _includes or layouts to generate multilingual content and social links.
• The _includes folder components are injected into the _layouts to create a cohesive HTML structure. These components are used to maintain consistency across the site (e.g., shared header/footer, blog sidebars).
• Assets (CSS, JS, fonts) are loaded into the final HTML outputs as referenced within layout or include files to deliver styles and functionality.
• The .htaccess file represents a deployment-level component that governs URL routing or redirection (e.g., directing traffic to the “pt” version if needed).
Architectural Patterns and Design Principles
• Template-Based Rendering: Jekyll’s model of splitting content into layouts, includes, and posts is an example of the templating pattern.
• Separation of Concerns: Configuration and data are isolated from presentation. Content is defined in Markdown, presentation is handled by layouts and includes, and style/branding by assets.
• Modular Design: The division into general components (global elements) and sections (specific blocks for content) makes it easier to reuse and customize pieces of the theme.
• Multi-language Support: By listing language files and instructions in the README, the project clearly separates language-specific content from processing logic.
• The separation between configuration/data and presentation.
• The modular approach to building pages via Jekyll’s templating system.
• How assets are integrated to give the final rendered output.
This approach ensures that each component’s role is clearly mapped out and the overall workflow—from source content and configuration to final static site generation—is clearly illustrated.