Skip to content

Lightweight personal homepage built with Rust (Rocket & Handlebars) and styled with TerminalCSS.

License

Notifications You must be signed in to change notification settings

itacentury/HomepageRs

Repository files navigation

HomepageRs

Rust lint, build & test Docker build & push

HomepageRs is a lightweight web project built with Rocket in Rust.

Prerequisites

Before building and running this project, make sure the following tools are installed:

  1. Rust toolchain

    Install Rust via rustup.

  2. Build tools

    Some platforms (like Linux) require development tools and dependencies.

  3. wasm-pack

    Used to compile the WebAssembly module:

    cargo install wasm-pack
  4. cargo-watch

    For automatically rebuilding and restarting the server on file changes:

    cargo install cargo-watch

Build & Run

  1. Build the WebAssembly

    Navigate to the nav directory and compile it for the web:

    wasm-pack build --target web --out-dir ../site/static/pkg

    This outputs the compiled WebAssembly and bindings to the site/static/pkg folder, where the Rocket site can serve it.

  2. Run the Rocket site

    • To manually start the backend server, navigate to the site directory and run:

      cargo run --release

      This starts the Rocket server and serves the frontend at http://localhost:8000.

    • For automatic rebuilds during development, run the following command from the root of the project:

      cargo watch -w site -s 'cd nav && wasm-pack build --target web --out-dir ../site/static/pkg && cd ../site && cargo run --release'

      This watches changes in the site directory, rebuilds WebAssembly, and restarts the Rocket server automatically.

Notes

  • Be sure to re-run wasm-pack build whenever you update the nav code.
  • Repository preview images have been generated with Github Social Image Generator

About

Lightweight personal homepage built with Rust (Rocket & Handlebars) and styled with TerminalCSS.

Resources

License

Stars

Watchers

Forks