Final changes for version 1.0
This commit is contained in:
parent
31a36815f8
commit
59662f20e6
2 changed files with 33 additions and 9 deletions
|
@ -6,15 +6,37 @@ class Index : Template
|
||||||
{
|
{
|
||||||
public this()
|
public this()
|
||||||
{
|
{
|
||||||
Title = "An aven website";
|
Title = "An Aven website";
|
||||||
OutputFile = "\\Index.html";
|
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)
|
public override void Body(HTML body)
|
||||||
{
|
{
|
||||||
body.Children.Add(Div(
|
|
||||||
H1("Aven Website"),
|
body.Children.Add(Empty(
|
||||||
Div("adssadsadsadsadsad", "asidosadsadsd")..SetValue("Style", "color:red;")
|
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")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -56,9 +56,11 @@ class Aven
|
||||||
|
|
||||||
..Append("<style>")
|
..Append("<style>")
|
||||||
..Append(page.Styles)
|
..Append(page.Styles)
|
||||||
..Append("</style>\n")
|
..Append("</style>\n");
|
||||||
|
|
||||||
..Append("</head>\n");
|
page.Head(toWrite);
|
||||||
|
|
||||||
|
toWrite.Append("</head>\n");
|
||||||
|
|
||||||
var body = page.Body(.. Custom("body"))..ToString(toWrite);
|
var body = page.Body(.. Custom("body"))..ToString(toWrite);
|
||||||
delete body;
|
delete body;
|
||||||
|
@ -76,7 +78,7 @@ class Aven
|
||||||
}
|
}
|
||||||
Directory.CreateDirectory(outDir).IgnoreError();
|
Directory.CreateDirectory(outDir).IgnoreError();
|
||||||
|
|
||||||
if (File.WriteAllText(scope $"{outputDir}{page.OutputFile}", toWrite) case .Err)
|
if (File.WriteAllText(scope $"{outputDir}/{page.OutputFile}", toWrite) case .Err)
|
||||||
{
|
{
|
||||||
Log.Error(scope $"Unable to write to file: {outputDir}{page.OutputFile}");
|
Log.Error(scope $"Unable to write to file: {outputDir}{page.OutputFile}");
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue