Commands Overview 🚀 ​
Rustic provides a simple, yet powerful CLI to manage your static site. This guide outlines all available commands to help you get the most out of Rustic.
1. init ​
Description: Initializes a new Rustic site in the current directory.
Usage: ​
rustic initWhat It Does: ​
Creates the following site structure:
your-site/ ├── static/ ├── output/ ├── themes/ │ └── dark.css │ └── light.css ├── content/ │ └── index.md │ └── meta.yaml ├── templates/default/ │ └── base.html └── rustic.config.jsoncontent/: Stores your Markdown content and
meta.yaml.themes/: Contains built-in and custom themes.
static/: Holds static assets like images and styles.
templates/: Contains HTML templates for your site.
rustic.config.json: Configuration file for site-wide settings like the title and theme.
2. build ​
Description: Builds your static site from the content and templates.
Usage: ​
rustic buildWhat It Does: ​
- Reads the Markdown files from the
content/directory. - Converts them into HTML using templates from the
templates/directory. - Outputs the resulting files to the
output/directory.
Generated structure: ​
output/
├── index.html
└── static/3. serve ​
Description: Starts a local development server with live-reload functionality.
Usage: ​
rustic serveWhat It Does: ​
- Serves the site from the
output/directory athttp://localhost:8080. - Watches the
content/directory for changes and automatically rebuilds the site. - Reloads the browser when changes are detected.
Example Output: ​
Server running at http://localhost:8080
Use Ctrl+C to stop the server4. clean ​
Description: Removes the output/ directory.
Usage: ​
rustic cleanWhat It Does: ​
- Deletes the entire
output/directory to provide a clean slate for the next build.
5. help ​
Description: Displays a list of available commands or detailed information about a specific command.
Usage: ​
rustic helpOr for specific command help:
rustic help <command>Example: ​
rustic help buildOutput:
Usage: rustic build
Description: Builds your static site from content and templates.Explore Rustic and unleash the power of static site generation! 🚀✨