A simple static site generator to handle different kinds of simple static websites.
🔗 GitHub Repository - Source code, issues, and releases
📖 Read the Blog → - Tutorials, guides, and tips for using Genereto
With Genereto, you can:
You should use Genereto if you want:
Recommended: Download the latest pre-built binary for Linux from GitHub Releases
# Download and extract
wget https://github.com/FedericoPonzi/genereto/releases/latest/download/genereto-*-linux-x86_64.tar.gz
tar -xzf genereto-*-linux-x86_64.tar.gz
Alternative: Build from source with cargo build --release
./genereto generate-project --project-path ./my-site
my-site/content/index.md
:---
title: My First Page
description: Welcome to my site
---
# Welcome!
This is my first page.
./genereto --project-path ./my-site
💡 Tip: Use the sample project as reference: check out
sample-genereto-project
folder in this repository. The generate project command will basically clone this folder.
# Basic usage
genereto --project-path <PATH>
# Generate new project
genereto generate-project --project-path <PATH> [--override-git]
# Draft options
genereto --project-path <PATH> --drafts-options <OPTION>
Draft options:
build
(default): Builds draft pages but doesn't link them (from the index page).dev
: Treats drafts as normal pageshide
: Completely skips draft pagesThe config.yml
file in your project root defines the site configuration:
template: string # Template directory name to use.
template_base_path: string # Custom path to templates folder (relative or absolute). By default will use project-path + "templates"
title: string # Website title (used in RSS)
url: string # Website URL (used in RSS)
description: string # Website description (used in RSS)
# Blog configuration (optional)
blog:
default_cover_image: string # Default image for pages without cover
base_template: index.html # Template for blog's article pages
index_name: index.html # Name of the blog index file
destination: "" # Blog output subdirectory
generate_single_pages: true # Generate individual article pages
title: string # Optional blog-specific title
content/
: Markdown files and assetstemplates/
: Default directory for HTML templates (unless template_base_path is specified)output/
: Generated site (created automatically)💡 Note: When
template_base_path
is specified in config.yml, templates will be searched in that location instead of the defaulttemplates/
directory. The path can be relative to the project root or absolute.
Available metadata fields for pages and articles:
Field | Type | Description | Default |
---|---|---|---|
title | string | Page/article title | Required |
publish_date | string | Publication date (YYYY-mm-dd). Posts with future dates are treated as drafts. | Optional |
is_draft | bool | Draft status | false |
keywords | string | Comma-separated keywords | Optional |
show_table_of_contents | bool | Enable ToC generation | false |
add_title | bool | Auto-add H1 title from metadata | false |
description | string | Brief description (first 150 chars if not provided) | Optional |
cover_image | string | Path to cover image | Optional |
url | string | External URL for the article. This will be available as article_url. | Optional |
current_year | string | Current year (auto-generated) | Auto |
custom_fields | any | Any additional key-value pairs | Optional |
⚠️ Notes:
- Articles with TODOs are automatically marked as drafts regardless of
is_draft
setting- Articles with future publish dates are automatically marked as drafts
- If no description is provided, the first 150 characters of content will be used
- Cover images can be relative paths or full URLs
Templates require two main files:
index.html
: For listing blog articlesblog.html
: For individual articlesContent replacement section:
<!-- start_content -->
Content here will be replaced
<!-- end_content -->
Variables are accessed using:
$GENERETO['variable_name']
💡 Tip: Use the content between start/end_content markers to preview your template's appearance.
You can add any custom key-value pairs to your page metadata, which will be available in templates as $GENERETO['key']
:
---
title: My Collaborative Post
publish_date: 2024-01-01
co_authors: John Doe, Jane Smith
project_url: https://github.com/example
---
# My Post
Written by $GENERETO['co_authors']
Check out the project at $GENERETO['project_url']
Any key-value pair that isn't a standard metadata field will be treated as custom metadata and made available in templates.
Genereto automatically generates an RSS feed. Add to your template:
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="rss.xml" />
Embed TODOs and comments in your content:
$GENERETO{TODO: fix this section}
This is my content $GENERETO{add more details here}
For tumblr-style blogs, use blog.yml
:
entries:
- title: My Post
publish_date: 2024-01-01
description: Quick update
💡 Tip: YAML entries support all the same metadata fields as markdown articles.
For more details, check out the introduction article.