#website-generator #static-website #website #generator #static #site

bin+lib stawege

A static website generator with a template engine that uses HTML tags

6 releases

0.3.2 Feb 3, 2025
0.3.1 Feb 3, 2025
0.2.2 Feb 3, 2025
0.1.0 Jan 31, 2025

#110 in Template engine

Download history 459/week @ 2025-01-31 37/week @ 2025-02-07

496 downloads per month

MIT license

39KB
883 lines

   ____   _____    _   __   _   __  ____    ___   ____
  |  __| |_   _|  / \  \ \_/ \_/ / |  __|  / __| |  __|
 __\ \     | |   / _ \  \   _   /  |  __| | |_-. |  __|
|____/     |_|  /_/ \_\  \_/ \_/   |____|  \___/ |____|

Static website generator

Stawege is a static website generator with a custom template engine that uses HTML tags. It is designed for static websites that work without JavaScript, and it has solutions to make it easier to make it possible to optionally load parts of the website dynamically via JavaScript if available.

Example

Source:

src/-layout.html

<SET lang?="en" title?="Default title" />

<html lang="{{ lang }}">
    <head>
        <title>{{ title }}</title>
    </head>
    <body>
        <BLOCK id="content">
            Default content
        </BLOCK>
    </body>
</html>

src/index.html

<SET title="Home" />

<EXTENDS path="-layout.html">
    <BLOCK id="content" copy-to="-/content.html">
        Greetings
    </BLOCK>
</EXTENDS>

Output:

www/index.html

<html lang="en">
    <head>
        <title>Home</title>
    </head>
    <body>
        Greetings
    </body>
</html>

www/-/content.html:

Greetings

(You can set values if they do not exist with a question mark (?) at the end of the attribute name, in the example above only the title is overwritten. )

(By default a file that starts with a dash (-) is private, which means it will not be built by itself. If it would not be private, a www/layout.html would be built.)

Installation

Via Cargo

Install cargo from here: https://www.rust-lang.org/tools/install

And then run the following command:

cargo install stawege

License

This project is licensed under the MIT License.

Dependencies