Getting Started with Rustic π β
Welcome to Rustic! This guide will help you install, set up, and create your first site with ease.
π οΈ Prerequisites β
Before you begin, make sure you have the following installed:
- Rust: Install Rust via rustup.rs.
- Git (Optional): For version control and cloning repositories.
- A Text Editor: Any editor of your choice (we recommend VS Code).
π₯ Installing Rustic β
You can install Rustic in three ways:
1. Install via Cargo β
If you have Rust installed, run the following command:
cargo install rustic-ssg
After installation, verify by running:
rustic --version
2. Download Prebuilt Binaries β
Rusticβs releases include prebuilt binaries for major platforms.
- Visit the Releases Page.
- Download the appropriate binary for your OS.
- Extract the downloaded file and add the binary to your system's PATH.
Verify installation:
rustic --version
3. Build from Source β
To build from source:
Clone the repository:
bashgit clone https://github.com/BersisSe/rustic-core.git cd rustic-core
Build the project:
bashcargo build --release
Add Rustic to your PATH:
bashexport PATH=$PATH:/path/to/rustic-core/target/release
Replace
/path/to/rustic-core
with the correct path to your cloned repository.Verify installation:
bashrustic --version
β¨ Creating Your First Site β
Initialize the site:
bashrustic init cd my-rustic-site
This sets up a basic site structure:
my-rustic-site/ βββ static/ βββ output/ βββ themes/ β βββ dark.css β βββ light.css βββ content/ β βββ index.md β βββ meta.yaml βββ templates/default/ β βββ base.html βββ rustic.config.json
Edit your content:
- Add Markdown files to the
content/
directory. - Customize the
templates/base.html
layout. - Modify
rustic.config.json
for site-wide settings (e.g., title, theme).
- Add Markdown files to the
βοΈ Building the Site β
Once youβve added your content, build the static site:
rustic build
This will generate an output/
directory with the HTML files.
π Previewing Your Site β
Use the built-in development server with live reload:
rustic serve
Visit the URL displayed (e.g., http://localhost:8080
) to preview your site. Changes in content/
will automatically reload in the browser.
π Next Steps β
Congratulations! Youβve successfully created and previewed your first Rustic site. Explore more in the docs:
Happy building! πβ¨