This is the repository for my own site hosted at https://michalvanko.dev
Feel free to use and ammend to code to your needs. Respect the Creative Commons BY-NC-ND 4.0 License for the content of the site.
The site is hosted as a static generated HTML files on the server via Caddy reverse proxy. There is an example Caddyfile that can be used for deployment on server. During development the axum web framework serves content as a HTTP server in a classic SSR HTML.
Look at the justfile for the available commands that are being used for development and deployment.
Use just server_dev
or just dev
for running the server for development purpose.
- Decap CMS
- Rust
- axum web framework
- tailwind
- wget for SSG
Deployment requires these steps:
- Ensure all images are generated
1.1 Run server in either
dev
orproduction
modejust prod
1.2 Crawl the site withjust ssg
command to ensure all routes are being hit to indicate that all images have to be generated. 1.3 Wait till the server stops generating images. Monitor the CPU load until it drops. Takes few minutes. just export
will start the server inproduction
mode and usewget
to recursively crawl the site. Remember, content has to be linked somewhere on the site to be discovered bywget
.just deploy
will synchronise the/dist
folder with the server withrsync
I want all images to be served to users optimally. All images that are used are generated in several sizes so they are optimized for different displays sizes. Browsers will pick and download the appropriate size.
I'd love to link some references for this problem, but I haven't found the exact use case that I was trying to solve.