· 5 min read
I rebuilt my website with Laravel Rust
What it was like to move this site from Jekyll to Laravel for Rust while learning Rust.
- #rust
- #laravel
- #laravel-rust
- #claude-code
This site ran on Jekyll for about a year and a half. It was a static site on GitHub Pages, built with the al-folio theme, and it worked fine. But I'm learning Rust, and when Laravel released Laravel for Rust, I wanted a real project to learn it on. My own website was the obvious pick: it's small, it's mine, and nobody gets hurt if I break it.
Getting started
I use Laravel Herd, and the latest Herd update installs the new Laravel CLI. The laravel new command now asks which language you want. I ran:
laravel new abbasali-rust --rust
It created the project, installed the frontend packages and compiled everything in one go. The first compile takes a few minutes. Rust is like that.
Working with Claude Code
I did the port together with Claude Code. I made the calls: the design, what to keep, and every word the site says about me. Claude Code read the framework source when the docs ran short, wrote most of the Rust, and ran into the same rough edges I would have. You'll find those further down.
What I kept and what I threw out
The starter app gives you a lot: Inertia, React, TypeScript, Postgres, queues and auth. A personal site needs almost none of it. I turned off the default Cargo features and kept the template engine:
laravel-rust = { version = "0.1", default-features = false, features = ["minijinja"] }
So there's no database. Sessions live in a cookie and the cache lives in memory.
The content sits in plain files under resources/content. Blog posts and news items are Markdown with a bit of YAML at the top. My CV is a JSON Resume file. When the app starts, it reads all of it into memory and turns the Markdown into HTML with the comrak crate. In debug mode it reads the files again on every request, so I can edit a post and refresh the page.
To publish, I add a file and push to GitHub.
It feels like Laravel
This surprised me the most. If you know Laravel, you can read a Laravel Rust app. Routes look like this:
route.get;
route.get;
route.get;
And this is the handler for the page you're reading:
pub async : )
Views use Jinja syntax. You get {% extends %}, {% block %} and {% include %}, so coming from Blade took me minutes. Tests look familiar too:
async
The site has 24 tests. They cover every page, the RSS feed, the sitemap and the redirects.
The old URLs still work. Laravel Rust has redirect routes built in, so old Jekyll tag and category pages send you to the right place with a 301:
route.permanent_redirect;
Where I got stuck
It's a 0.1 release, and I hit a few rough edges.
The docs aren't in the crate. The starter project expects the framework docs to ship inside the crate, but version 0.1.0 leaves them out. I read them in the laravel/rust-framework repo on GitHub instead.
/blog and /blog/ are the same route. I registered both, one of them as a redirect, and the app refused to start with "registered twice". The router already treats them as one, so I deleted the redirect.
A catch-all route hid my static files. I served pages like /teaching/ with a /{page}/ route. That route also matched /robots.txt and /favicon.png, so they returned 404. I moved those pages to the fallback route, because Laravel checks the public folder before it runs the fallback.
Production checks the host. With APP_ENV=production, the app answers requests for the host in APP_URL and its subdomains, and everything else gets a 400. It's a good default, but it caught me twice: once when I tested the release build on my laptop, and again while I moved the domain. I now list the trusted hosts in src/app.rs.
Shipping it
I deployed to Laravel Cloud. It recognised the app as Laravel Rust and filled in the build and start commands for me. The first build took about three minutes. Later builds take about a minute.
Then I moved the domain. Cloud let me prove I own it and get the SSL certificate before I touched the live DNS. When I switched the records, the site moved over with no downtime.
The numbers
- The release binary is 28 MB. Most of that is syntax highlighting data for code blocks.
- On my laptop, the release build serves a page in under a millisecond.
- The site ships 6 KB of CSS (gzipped) and less than 1 KB of JavaScript. The JavaScript runs the dark mode toggle and the "Download PDF" button on my CV.
Would I do it again?
Yes. I wanted to learn Rust on something real, and this was a good size for it. Laravel Rust lets me lean on what I know from Laravel while I learn the Rust parts: Option, Result, and a compiler that tells me what I got wrong before the code runs.
It's still beta, so expect a few rough edges. For a small site like this one, it was a fun way to start.
The code is on GitHub at abbasali/abbasali-rust if you want to see how it fits together. Questions go in the comments below.