This repository holds my personal website dpbriggs.ca.
Feel free to fork and modify this website. Please note this website is under GPLv3 so be sure to keep the license and attribute.
Built with:
- Rocket 🚀 (Rust Web Framework)
- Tera (Fast templating language/engine, similar to Jinja2)
- Bootstrap (CSS framework)
Running the website locally is pretty easy, thanks to cargo
and rustup
.
- Be sure you have rustup to install a nightly toolchain.
- Install a nightly toolchain
rustup toolchain add nightly
- Set nightly as your default toolchain
rustup default nightly
- Clone and enter the project
git clone [email protected]:dpbriggs/dpbriggs-blog.git && cd dpbriggs-blog
- Run the project
cargo run
- (optional) rename the project (replace
myname
with whatever you want):mv dpbriggs-blog myname-blog
- Edit
Cargo.toml
and change instances ofdpbriggs
in there tomyname
- Edit
src/context.rs
and update the default site context.
Alternatively, use the make file:
make watch # live-reload make test # run tests
As is tradition, we need several ways to build the website.
The server which runs my website is running a stable version of Ubuntu, and my arch system
has a relatively new version of Glibc. It’s no longer possible for me to run make_package.sh
and upload the artifacts.
So I added a quick docker container which will generate the build artifacts.
To build the container:
cd docker docker build . -t blog-maker
This will setup a container with rust running ubuntu 18.04.
To generate a build artifact:
docker run --rm -v ~/programming/dpbriggs-blog:/source blog-maker
This will output something like:
... rust build stuff ... Created project archive dpbriggs-blog-Aug-15-2021-06-47PM.zip in current directory. Simply copy to server, unzip, and use: systemctl --user restart run_site run_caddy
If this succeeds, you’ll have a new artifact that looks like dpbriggs-blog-Aug-15-2021-06-47PM.zip
in the repo root.
NOTE: This zip only builds off of the latest committed master. Some files, like .caddy-env
will need to be copied onto the server normally.