I have been doing a lot of research on developing a personal website with Rust recently. Of course, the quickest and most direct way is to use the Zola framework, but I always wanted to try writing my own. So, I searched for two great examples.
The first one is zzhack, which uses the Yew framework. It writes high-performance frontend applications with Yew and uses another CLI tool to write the paths of Markdown files to the entire project, ultimately generating the entire static website. I like how the program overcomes the limitation of Trunk’s inability to read files through the CLI tool and simplifies the process of uploading articles. If you are looking for a way to solve the problem of static site generators not being able to read files and simplify the process of uploading articles, then the methods in this one are worth referring to.
The second one is kerkour’s rust-static-site-generator. If you are looking for a simple yet powerful way to read md files inside a directory and convert them to HTML, this one is worth referring to. Even as an unfinished product, the author made a simple static site generator using only 100 lines of code. The author also provides some directions for modification, which is very helpful. If you have any questions about using Axum to read static files, you can refer to the static-file-server.
If you are looking for a way to develop a static site generator with Rust, these two examples are great references. zzhack uses the Yew framework and CLI tool to simplify the process of uploading articles. At the same time, kerkour’s rust-static-site-generator completed a simple but powerful static site generator using only 100 lines of code, which is worth referring to.