lyweb

Crates.iolyweb
lib.rslyweb
version0.1.1
created_at2025-09-02 03:52:42.635906+00
updated_at2025-09-02 03:52:42.635906+00
descriptionSimple templating library designed for personal websites
homepage
repositoryhttps://github.com/Denendaden/lyweb
max_upload_size
id1820587
size12,741
LYRA (Denendaden)

documentation

README

LyWeb - lyra's website library

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.

How it works

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.

Commit count: 11

cargo fmt