michalvanko.dev site
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.
Architecture
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.
Development
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.
Tools and libraries used for generating the content
- Decap CMS
- Rust
- axum web framework
- tailwind
- wget for SSG
Deployment
Deployment requires these steps:
- Ensure all images are generated
1.1 Run server in either devorproductionmodejust prod1.2 Crawl the site withjust ssgcommand 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 exportwill start the server in- productionmode and use- wgetto recursively crawl the site. Remember, content has to be linked somewhere on the site to be discovered by- wget.
- just deploywill synchronise the- /distfolder with the server with- rsync
Image generation
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.