soupault
Generate static websites from templates
TLDR
Initialize a minimal website project in the current working directory
Build a website
Override default configuration file and directory locations
Extract metadata into a JSON file without generating pages
Show the effective configuration (values from soupault.toml plus defaults)
SYNOPSIS
soupault [-c config.file] [-d directory] [-v] [-V]
PARAMETERS
-c config.file
Specify the configuration file to use. The default is soupault.conf.
-d directory
Set the working directory for soupault. Defaults to the current directory.
-v
Enable verbose output.
-V
Print the soupault version and exit.
DESCRIPTION
Soupault is a static website generator that uses HTML rewriting instead of templating.
It takes existing HTML files and processes them based on rules defined in a configuration file. This approach offers greater flexibility compared to traditional static site generators, allowing you to modify existing websites, use external APIs, and integrate with other tools more easily. Soupault can perform tasks such as inserting common page elements, updating content, generating navigation menus, and optimizing images. It's particularly well-suited for projects where you need to add dynamic features to an existing static website, or when you prefer a more declarative approach to content generation.
CAVEATS
Soupault's power comes from its configuration, which can be complex depending on the website's requirements. Understanding HTML and CSS selectors is important for effectively using soupault.
CONFIGURATION
The soupault.conf file defines how soupault processes your website.
It includes sections for global settings, page-specific rules, and widget definitions. Widgets are reusable components that can be inserted into multiple pages. Soupault provides various built-in widgets and allows you to define custom widgets.
HTML REWRITING
Soupault uses CSS selectors to identify elements in your HTML files.
You can then specify actions to perform on those elements, such as replacing their content, adding attributes, or removing them entirely.
This makes it easy to modify your HTML structure and content without having to write complex code.
USE CASES
Soupault is useful for various static website generation tasks, including:
- Adding a consistent header and footer to all pages
- Generating a navigation menu based on the directory structure
- Optimizing images for web use
- Integrating data from external APIs into your website