AGENTS.md

This file contains guidelines for AI coding agents working on this repository.

Project Overview

Personal Page is a static website built with Rust (Actix-web) and Maud templating. It features a dark theme personal portfolio website.

Build/Lint/Test Commands

# Run the application
just run

# Format code
just fmt

# Run verification
just verify

# Build release
just build

Direct Cargo Commands

# Check code without building
cargo check

# Run linter
cargo clippy

# Format code
cargo fmt

# Run tests
cargo test

# Build release
cargo build --release

Code Style Guidelines

Imports

  • Group imports: std library first, then external crates, then local modules
  • Use use crate:: for local module imports

Formatting

  • Run cargo fmt before committing
  • Run cargo clippy and fix all warnings
  • 4 spaces for indentation (Rust default)

Types and Naming

  • Structs/Enums: PascalCase
  • Functions/Variables: snake_case
  • Constants: SCREAMING_SNAKE_CASE
  • Modules: snake_case

Error Handling

  • Use Result<T, E> for fallible operations
  • Propagate errors with ? operator when appropriate
  • Handle Option with if let or match rather than .unwrap()

HTML/Views

  • Use maud for HTML templating
  • Use maud::html! macro for markup
  • Use maud::DOCTYPE for doctype declaration
  • Check for HX-Request header to determine if rendering full layout or partial content

Request Handlers

  • Use Actix-web macros: #[get("/path")], #[post("/path")]
  • Return impl Responder or specific types like AwResult<maud::Markup>

Environment Variables

  • PORT: Server port (default: 8080)
  • LOG_LEVEL: Logging level (default: info)

Endpoints

  • / - Home page
  • /about - About page
  • /projects - Projects portfolio
  • /contact - Contact page
  • /health - Health check endpoint
  • /up - Up/ready check endpoint (returns 200 when server is ready)
  • /assets/* - Static assets (CSS, JS)

Dependencies

Key crates used:

  • actix-web: Web framework
  • maud: HTML templating (with actix-web feature)
  • env_logger: Logging
  • tokio: Async runtime

Styling

Uses Tachyons CSS (t.css) with a dark theme:

  • Black background (bg-black)
  • White text (white)
  • White opacity variants (white-70, white-60, white-50)

Static Assets

Assets are embedded in the binary using include_str!:

  • t.css - Tachyons CSS
  • h.js - HTMX library
  • hx-response-targets.js - HTMX response targets extension