2024-12-06 18:54:16 +01:00
# Aven
Aven is an incredibly easy to use html page generator.
It achieves this by embedding html in Beef function calls, so that you can define your website layout in Beef while using all of the normal programming language features that Beef provides.
This results in naturally easy templating
2024-10-30 13:47:07 +01:00
2024-12-06 18:54:16 +01:00
```cs
class Program
{
public static void Main()
{
Aven aven = scope .();
aven.CopyToOutput("../favicon.ico", "favicon.ico");
aven.Register(.Owning(new Index()));
aven.Build();
}
}
class Index : Template
{
public this()
{
Title = "An Aven website";
OutputFile = "Index.html";
this.Styles = """
body {
background-color:#89c5bb ;
font-family: sans-serif;
font-size: 1.2rem;
}
""";
}
public override void Head(System.String buffer)
{
buffer.Append("< link rel = \"icon \" href = \"favicon.ico \"/ > ");
}
public override void Body(HTML body)
{
body.Children.Add(Empty(
H1("Aven"),
Hr(),
"Build static websites dynamically using Aven",
Ul(
Li("Fast"),
Li("Easily extendable"),
Li("Leverage the power of a normal programming language instead of just templating")
),
Br(),
A("Aven Repository")..SetValue("href", "https://code.booklordofthe.dev/Booklordofthedings/Aven")
));
}
}
```