From 59662f20e6e514d212418c355a51eff5c835b1d1 Mon Sep 17 00:00:00 2001 From: Booklordofthedings Date: Fri, 6 Dec 2024 18:48:54 +0100 Subject: [PATCH] Final changes for version 1.0 --- Example_Website/src/Index.bf | 34 ++++++++++++++++++++++++++++------ src/Aven.bf | 8 +++++--- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Example_Website/src/Index.bf b/Example_Website/src/Index.bf index 1529de2..61cf13a 100644 --- a/Example_Website/src/Index.bf +++ b/Example_Website/src/Index.bf @@ -6,15 +6,37 @@ class Index : Template { public this() { - Title = "An aven website"; - OutputFile = "\\Index.html"; + 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(""); } public override void Body(HTML body) { - body.Children.Add(Div( - H1("Aven Website"), - Div("adssadsadsadsadsad", "asidosadsadsd")..SetValue("Style", "color:red;") - )); + + 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") + )); } } \ No newline at end of file diff --git a/src/Aven.bf b/src/Aven.bf index b5526e2..e585ad2 100644 --- a/src/Aven.bf +++ b/src/Aven.bf @@ -56,9 +56,11 @@ class Aven ..Append("\n") + ..Append("\n"); - ..Append("\n"); + page.Head(toWrite); + + toWrite.Append("\n"); var body = page.Body(.. Custom("body"))..ToString(toWrite); delete body; @@ -76,7 +78,7 @@ class Aven } 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}"); continue;