mirror of
https://git.ohcooltools.dev/Ohcool-Media/askama-template.git
synced 2026-06-07 18:02:45 +00:00
Template for projects using askama
- Jinja 36.5%
- Rust 31.3%
- Dockerfile 22%
- CSS 10.2%
| .forgejo/workflows | ||
| .zed | ||
| public | ||
| scripts@1a0e9210b8 | ||
| src | ||
| templates | ||
| .env.dev | ||
| .env.prod | ||
| .gitignore | ||
| .gitmodules | ||
| .prettierrc | ||
| cargo-generate.toml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| rustfmt.toml | ||
Askama + Axum + HTMX Starter Template
A production-ready template for building websites with Askama, Axum, and HTMX.
Features
- Askama - Type-safe, compiled Jinja-like templates
- Axum - Modern, fast Rust web framework
- HTMX - Dynamic HTML without JavaScript frameworks
- TLS/HTTPS - Built-in support with
axum-serverand Let's Encrypt certs - Forgejo CI - CI workflows for clippy, tests, formatting
- Zed Editor config - Formatter integrations for TOML, HTML, CSS, YAML, JSON, Docker
Quick Start with cargo-generate
cargo generate --git ssh://git@git.ohcooltools.dev/Ohcool-Media/askama-template.git
This will create a new project from the template. Follow the prompts to name your project.
Manual Setup
- Clone this repository
- Rename the project in
Cargo.toml
Development
Run the server (HTTPS on 2040):
cargo run
Project Structure
.
├── Cargo.toml
├── cargo-generate.toml # cargo-generate config
├── rustfmt.toml # Rust formatting config
├── .prettierrc # Prettier config for templates
├── .gitignore
├── .forgejo/
│ └── workflows/ # CI workflows
├── .zed/
│ └── settings.json # Zed editor config
├── scripts/ # Formatting/utility scripts
├── public/
│ └── style.css # Your stylesheets
├── src/
│ └── main.rs # Server entry point
└── templates/
├── base.html # Base layout
├── header.html # Site header (included)
├── footer.html # Site footer (included)
├── index.html # Home page
└── about.html # About page
Deploying
- Run the binary or use Docker
Customization
- Add templates in
templates/ - Add Askama template structs in
src/main.rs - Add routes with
Router::new().route(...) - Add static assets in
public/
License
MIT