Askama website template
  • Shell 37.7%
  • Jinja 23.4%
  • Rust 19.3%
  • Dockerfile 11.6%
  • CSS 8%
Find a file Use this template
Blair Hines 73df47730a
Some checks failed
deploy-prod.yml / fix: Fix remaining issues, good to use (push) Failing after 0s
fix: Fix remaining issues, good to use
2026-05-26 13:52:14 -04:00
.forgejo/workflows feat: Add unused dep checker ci 2026-05-26 12:43:49 -04:00
.zed feat: Updated template 2026-05-26 12:41:00 -04:00
public feat: Updated template 2026-05-26 12:41:00 -04:00
scripts feat: Add unused dep checker ci 2026-05-26 12:43:49 -04:00
src fix: Fix remaining issues, good to use 2026-05-26 13:52:14 -04:00
templates fix include paths in base template 2026-05-26 13:29:36 -04:00
.gitignore feat: Updated template 2026-05-26 12:41:00 -04:00
.prettierrc feat: Updated template 2026-05-26 12:41:00 -04:00
cargo-generate.toml fix: Fix duplicate key 2026-05-26 13:13:31 -04:00
Cargo.lock fix: Fix remaining issues, good to use 2026-05-26 13:52:14 -04:00
Cargo.toml fix: Fix remaining issues, good to use 2026-05-26 13:52:14 -04:00
docker-compose.yml fix: Fix remaining issues, good to use 2026-05-26 13:52:14 -04:00
Dockerfile fix: Fix remaining issues, good to use 2026-05-26 13:52:14 -04:00
LICENSE Create LICENSE 2026-05-25 15:51:37 -04:00
README.md fix: Fix readme 2026-05-26 13:01:47 -04:00
rustfmt.toml feat: Updated template 2026-05-26 12:41:00 -04:00

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-server and 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

  1. Clone this repository
  2. Rename the project in Cargo.toml
  3. Generate TLS certificates:
    mkdir -p private
    openssl req -x509 -newkey rsa:4096 -keyout private/key.pem -out private/cert.pem -days 365 -nodes
    

Development

Run the server (HTTPS on 2047):

cargo run

You'll need TLS certificates in private/. Generate self-signed ones for dev:

mkdir -p private
openssl req -x509 -newkey rsa:4096 -keyout private/key.pem -out private/cert.pem -days 365 -nodes

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
├── private/                  # TLS certs (gitignored)
├── 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

  1. Set up TLS certificates via Let's Encrypt
  2. 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