lyweb 0.1.1

Simple templating library designed for personal websites
Documentation
  • Coverage
  • 100%
    16 out of 16 items documented2 out of 10 items with examples
  • Size
  • Source code size: 12.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 445.97 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • denendaden/lyweb
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • denendaden

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.