| Crates.io | lyweb |
| lib.rs | lyweb |
| version | 0.1.1 |
| created_at | 2025-09-02 03:52:42.635906+00 |
| updated_at | 2025-09-02 03:52:42.635906+00 |
| description | Simple templating library designed for personal websites |
| homepage | |
| repository | https://github.com/Denendaden/lyweb |
| max_upload_size | |
| id | 1820587 |
| size | 12,741 |
This is a library written in Rust that I created for my personal website, https://lyra.pink, containing the functionailty that seemed like it could be reproduced for other websites. It is very simple and not very featureful, but I decided to publish it separately from my website in the hope that maybe someday someone will find it useful for making their own website.
LyWeb works by modifying a template with some provided content. A template file might contain the following:
...
<div id="contents">
[[content]]
</div>
...
LyWeb provides functions to replace the text [[content]] with some content.
This means you can ensure consistent styling, etc. across all pages that use the
same template. An example of this in use, taken from
my own website:
LyWebpage::from_file("templates/main.html")?
.fill_from_file("content", "www/content.html")?
.contents
This snippet would return a String that could be sent in a response to a
request.