Jekyll - Rust Reimplementation
Overview
Jekyll is a simple, blog-aware static site generator, now reimplemented in Rust for even better performance and reliability. It's designed to help you build beautiful, content-focused websites with ease, using Markdown and Liquid templates.
π― Key Features
- π Fast Builds: Compile your site in seconds, not minutes
- π¨ Liquid Templating: Use Jekyll's powerful Liquid template system
- π¦ Easy Deployment: Generate static files that work anywhere
- π§ Extensible: Customize with plugins and themes
- π Developer Friendly: Great tooling and developer experience
- π Markdown Support: Write content in Markdown with ease
- π Cross-Platform: Works on Windows, macOS, and Linux
- π± 100% Compatible: Full compatibility when using static features
Installation
From Crates.io
From Source
# Clone the repository
# Build and install
Usage
Create a New Site
Develop Locally
This will start a local development server with hot reloading, so you can see your changes in real-time.
Build for Production
This will generate optimized static files in the _site directory, ready for deployment.
Architecture
Jekyll follows a modular architecture designed for performance and extensibility, leveraging external libraries for enhanced functionality:
flowchart TD
A[CLI] --> B[Config Loader]
B --> C[Content Scanner]
C --> D[Parser]
D --> E[Liquid Templating]
E --> F[Output Generator]
G[Plugins] --> E
H[Themes] --> E
I[nargo] --> E
J[oak] --> D
K[IPC] --> G
Core Components
- CLI: Command-line interface for interacting with the compiler
- Config Loader: Reads and parses Jekyll configuration files (YAML)
- Content Scanner: Discovers and processes content files
- Parser: Converts Markdown to HTML (uses oak)
- Liquid Templating: Renders content using Liquid templates
- Output Generator: Writes final static files
- Plugins: Extend functionality with custom plugins (uses IPC mode)
- Themes: Provide reusable templates and styles
- nargo: External library with analysis engines and bundlers
- oak: External library for parsing
- IPC: Inter-process communication for plugin system
Configuration
Here's an example _config.yml file:
# Site settings
title: My Jekyll Site
description: A site built with Rusty Jekyll
author: Your Name
email: your.email@example.com
baseurl:
url: "https://example.com"
# Build settings
destination: _site
permalink: /:year/:month/:day/:title/
markdown: kramdown
highlighter: rouge
# Theme settings
theme: minima
# Plugins
plugins:
- jekyll-feed
- jekyll-sitemap
- jekyll-seo-tag
# Exclude from processing.
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor/bundle/
- vendor/cache/
- vendor/gems/
- vendor/ruby/
Examples
Example Blog Post
Here's an example of a blog post in Jekyll:
layout: post
title: "Getting Started with Jekyll"
date: 2024-01-01 10:00:00 +0000
categories: tutorial getting-started
tags: jekyll static-site-generator
Welcome to Jekyll! This is your first blog post.
Jekyll is a simple, blog-aware static site generator written in Rust.
- ----
Jekyll uses Liquid templates for flexible content rendering:
{% raw %}{% if page.title %}
{% for post in site.posts limit: 5 %}
1. 2.3.4.
Happy coding! π
Example Layout
Here's an example of a Jekyll layout:
<!-- _layouts/default.html -->
{{ site.title }}
{% raw %}{% feed_meta %}{% endraw %}
{% raw %}{% seo %}{% endraw %}
{% raw %}{% include header.html %}{% endraw %}
{{ content }}
{% raw %}{% include footer.html %}{% endraw %}
Compatibility Note
β οΈ Important: Jekyll provides 100% compatibility only when using static features. Dynamic features may have limited support or require additional configuration.
Plugins
Jekyll supports a wide range of plugins to extend functionality (using IPC mode):
- π jekyll-feed: Generate RSS/Atom feeds
- πΊοΈ jekyll-sitemap: Generate sitemap.xml
- π jekyll-seo-tag: Add SEO meta tags
- π¨ jekyll-paginate: Add pagination to your blog
- πΌοΈ jekyll-responsive-image: Responsive image support
Themes
Choose from a variety of Jekyll themes or create your own:
- π¨ minima: Default theme, clean and modern
- π minimal-mistakes: Versatile, responsive theme
- π jekyll-theme-blog: Blog-focused theme
- π jekyll-theme-docs: Documentation-focused theme
- πΌ jekyll-theme-cayman: Project page theme
Deployment
Jekyll generates static files that can be deployed anywhere:
Netlify
# netlify.toml
[]
= "jekyll build"
= "_site"
Vercel
// vercel.json
GitHub Pages
# .github/workflows/deploy.yml
name: Deploy
on:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: cargo install jekyll
- run: jekyll build
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
Contribution Guidelines
We welcome contributions to Jekyll! π€
Reporting Issues
If you find a bug or have a feature request, please open an issue.
Pull Requests
- Fork the repository
- Create a new branch
- Make your changes
- Run tests
- Submit a pull request
Code Style
Please follow the Rust style guide and use cargo fmt to format your code.
Acknowledgements
Jekyll is inspired by the original Jekyll project and benefits from the Rust ecosystem, including the nargo and oak libraries.
License
Jekyll is licensed under the terms specified in the LICENSE file. See LICENSE for more information.
Happy building with Jekyll! π