Genereto Documentation

Genereto

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

Table of Contents

Features

With Genereto, you can:

You should use Genereto if you want:

Quick Start Tutorial

Installation

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

Usage

  1. Create a new project:
./genereto generate-project --project-path ./my-site
  1. Create a new file in my-site/content/index.md:
---
title: My First Page
description: Welcome to my site
---
# Welcome!
This is my first page.
  1. Build your site:
./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.

CLI Reference

# 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:

Config Reference

The 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

Directory Structure

💡 Note: When template_base_path is specified in config.yml, templates will be searched in that location instead of the default templates/ directory. The path can be relative to the project root or absolute.

Metadata Fields Reference

Available metadata fields for pages and articles:

FieldTypeDescriptionDefault
titlestringPage/article titleRequired
publish_datestringPublication date (YYYY-mm-dd). Posts with future dates are treated as drafts.Optional
is_draftboolDraft statusfalse
keywordsstringComma-separated keywordsOptional
show_table_of_contentsboolEnable ToC generationfalse
add_titleboolAuto-add H1 title from metadatafalse
descriptionstringBrief description (first 150 chars if not provided)Optional
cover_imagestringPath to cover imageOptional
urlstringExternal URL for the article. This will be available as article_url.Optional
current_yearstringCurrent year (auto-generated)Auto
custom_fieldsanyAny additional key-value pairsOptional

⚠️ Notes:

Templating Guide

Templates require two main files:

Content 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.

Advanced Features

Custom Metadata

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.

RSS Feed

Genereto automatically generates an RSS feed. Add to your template:

<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="rss.xml" />

TODOs and Comments

Embed TODOs and comments in your content:

$GENERETO&#123;TODO: fix this section&#125;
This is my content $GENERETO&#123;add more details here&#125;

Blog YAML Format

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.