AGENTS.md - Jekyll Blog Development Guide
Build Commands
First-time Setup
bundle install
Local Development
# Start Jekyll server with live reload
bundle exec jekyll serve --livereload --future
# Runs at http://127.0.0.1:4000/
Testing
Build checks: bundle exec jekyll build –quiet && python -m unittest scripts.test_site_build -v
No unit test framework. Use Playwright MCP for browser testing:
- Navigate with
mcp_playwright_browser_navigate - Check console errors with
mcp_playwright_browser_console_messages - Test responsive design with
mcp_playwright_browser_resize - Take screenshots with
mcp_playwright_browser_take_screenshot
Test these scenarios:
- Home page with pagination
- Individual blog posts with TOC
- Tags page filtering
- Navigation flows
- Responsive layouts (mobile/tablet/desktop)
- Console errors and network failures
Project Architecture
Theme: Reading-first, light and dark
- CSS custom properties in
_sass/_tokens.scss(light on:root, dark onhtml[data-theme="dark"]): bg, surface, text, mute, border, accent, path, string, code-*. - Inter for body text (17px, 18px from 768px, line-height 1.65); JetBrains Mono for code, meta, tags, and the signature line.
- Reading column max-width 42rem (
.wrap). Posts add a sticky table-of-contents rail from 1100px. - Theme toggle in the header, persisted in
localStorage.theme, default fromprefers-color-scheme. - Exactly one signature PowerShell line per page, rendered by
_includes/signature.html. No other command-styled UI: nav, links, buttons and footer are plain text.
Layout Hierarchy
base.html- head with theme bootstrap, sticky header (brand, Blog · Tags · About, theme toggle), reading-progress bar on posts, footer (LinkedIn, GitHub, X, RSS), scripts, Mermaidhome.html- intro with signature line, paginated post list, pagerpost.html- signature line, title, deck, meta, author, TOC (rail on desktop,<details>below 1100px), body, share links, previous/nextpage.html- title, optional description, body (About, Tags)
File Structure
_posts/: Blog posts (YYYY-MM-DD-title.md)_layouts/: Jekyll templates_includes/: Reusable components (signature.html, toc.html, google-analytics.html)_sass/: one partial per component, see SCSS Stylesassets/css/main.scss: Compiled CSSassets/js/: JavaScript functionalityassets/images/YYYY-MM-DD-post-slug/: Post images
Code Style Guidelines
Liquid Templates (Jekyll)
- Use
{%- -%}for whitespace control - Semantic HTML5 elements
- Cache-busting for JS:
?v={{ site.time | date: '%s' }} - Reference assets with
| relative_urlfilter
SCSS Styles
- One partial per component in
_sass/:_tokens,_base,_typography,_header,_footer,_post-list,_post,_toc,_code,_tags;assets/css/main.scssonly imports - Colours and fonts only via the custom properties from
_tokens.scss; never hardcode a hex value in a component partial - BEM-like naming (
block__element--modifier), state classesis-current,is-active - Mobile first; breakpoints 600px, 768px, 1100px
JavaScript
- ES6+ syntax with proper event listeners
- Use
DOMContentLoadedfor initialization - Modern event handling with addEventListener
- No jQuery - vanilla JS preferred
- Scripts in
assets/js/with cache-busting in base.html
Blog Posts (Markdown)
- Format: Kramdown parser with GFM input
- Front matter structure:
--- layout: post title: "Post Title" date: YYYY-MM-DD categories: [Category1, Category2] author: Flemming Bakkensen description: "SEO-friendly description" tags: [tag1, tag2] --- - Use
<!--more-->separator for excerpt - Add emojis to headers:
## 🚀 Introduction - Code blocks with Rouge syntax highlighting
- Include tables, diagrams (Mermaid.js available)
- Target audience: AL developers for Business Central
Naming Conventions
- Posts:
YYYY-MM-DD-title-slug.md - Layouts: kebab-case (base.html, post.html)
- SCSS classes: BEM-like with theme prefixes
- Images: timestamp-based naming in post-specific folders
Error Handling
- Check for YAML front matter syntax errors
- Validate HTML/CSS in generated
_site/directory - Test locally before pushing to GitHub Pages
- Monitor GitHub Actions workflow for build failures
Configuration
_config.yml Key Settings
- Pagination: 5 posts per page
- Plugins: jekyll-feed, jekyll-seo-tag, jekyll-paginate, jekyll-sitemap
- Markdown: Kramdown with Rouge syntax highlighting
- Google Analytics: G-5FQ1BD5CNH (production only)
- Social links: LinkedIn, GitHub, X/Twitter
Tags System
- Tags defined in post front matter:
tags: [tag1, tag2] /tags.htmluses JavaScript for tag cloud and filtering- No manual tag pages needed - auto-generated
Common Tasks
Adding a New Blog Post
- Create
_posts/YYYY-MM-DD-title.md - Add front matter with required fields
- Write content with
<!--more-->separator - Add emojis to headers
- Include code examples with syntax highlighting
- Test locally with
bundle exec jekyll serve --livereload
Modifying the Theme
- Colors/Fonts: Edit
_sass/_tokens.scss - Layout structure: Modify
_layouts/base.html - Navigation: Update the header block in
_layouts/base.html - Post template: Edit
_layouts/post.html
Build Process
- Jekyll builds to
_site/directory (git-ignored) - GitHub Pages auto-deploys from main branch
- Nightly rebuild via
.github/workflows/nightly-build.yml
Troubleshooting
Common Issues
- Server won’t start: Run
bundle install - Changes not reflecting: Check YAML front matter syntax
- TOC not appearing: Ensure h2-h6 headers exist
- Pagination broken: Verify
paginate: 5in config
Debugging
- Check Jekyll build output for errors
- Use browser DevTools for console errors
- Validate generated HTML in
_site/directory
Do Not Modify
_site/directory (Jekyll build output)Gemfile.lock(unless updating dependencies).github/instructions/playwright.instructions.md(testing rules)