added: documentation pages started
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 24 Mar 2023 04:21:44 +0000 (23:21 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 24 Mar 2023 04:21:44 +0000 (23:21 -0500)
14 files changed:
onyx-pkg.ini
src/app.onyx
www/static/css/new_style.css
www/static/images/logo.svg
www/templates/pages/404.html
www/templates/pages/docs.html
www/templates/pages/docs/getting_started.html [new file with mode: 0644]
www/templates/pages/docs/install.html [new file with mode: 0644]
www/templates/pages/docs/reference.html [new file with mode: 0644]
www/templates/pages/homepage.html
www/templates/pages/news.html
www/templates/pages/news_article.html
www/templates/pages/normal_page.html [new file with mode: 0644]
www/templates/partials/navbar.html

index 388de1a8bcbf48170bdfcbabac282f0448da8866..3d256dddc2c38ceeba1a772f84b75d745e5f5278 100644 (file)
@@ -17,9 +17,9 @@ build_cmd=
 library=
 
 [dependencies]
-git://onyxlang.io/repo/http-server=0.1.12
-git://onyxlang.io/repo/postgres-orm=0.0.20
-git://onyxlang.io/repo/otmp=0.0.4
+git://onyxlang.io/repo/http-server=0.1.19
+git://onyxlang.io/repo/postgres-orm=0.0.24
+git://onyxlang.io/repo/otmp=0.0.6
 
 [dependency_folders]
 git://onyxlang.io/repo/http-server=http-server
index 494c1f261fe4560156a398fb93241908bcb976a7..50384342144df56e94ce6fe852f6956c15d4e9e3 100644 (file)
@@ -4,36 +4,41 @@
 }
 
 use core
-use http {Req :: Request, Res :: Response}
+use http.server {Req :: Request, Res :: Response, route}
 
 reg: otmp.TemplateRegistry;
-#inject http.Response {
-    render :: (r: ^http.Response, template: str, vars: any) {
-        s := reg->render_template(template, ^r.writer, .{ vars.data, vars.type });
+#inject Res {
+    render :: (r: &Res, template: str, vars: any) {
+        s := reg->render_template(template, &r.writer, .{ vars.data, vars.type });
         r->status(200 if s == .None else 400);
         r->end();
     }
 }
 
-@http.route.{.GET, "/"}
-(req: ^Req, res: ^Res) {
-    res->render("homepage", null);
+@route.{.GET, "/"}
+(req: &Req, res: &Res) {
+    res->render("pages/homepage", null);
 }
 
-@http.route.{.GET, "/docs"}
-(req: ^Req, res: ^Res) {
-    res->render("docs", null);
+@route.{.GET, "/docs"}
+(req: &Req, res: &Res) {
+    res->render("pages/docs", null);
 }
 
-@http.route.{.GET, "/news"}
-(req: ^Req, res: ^Res) {
+@route.{.GET, "/docs/install"}
+(req: &Req, res: &Res) {
+    res->render("pages/docs/install", null);
+}
+
+@route.{.GET, "/news"}
+(req: &Req, res: &Res) {
     if a := req.query->get_opt("a"); a {
         filename := tprintf("www/news-articles/{}.html", a.value);
         if os.file_exists(filename) {
             article := os.get_contents(filename);
-            defer delete(^article);
+            defer delete(&article);
 
-            res->render("news_article", ^.{
+            res->render("pages/news_article", &.{
                 article = article
             });
         }
@@ -42,13 +47,13 @@ reg: otmp.TemplateRegistry;
         articles := make([..] str);
 
         for os.list_directory("www/news-articles") {
-            name := it->name(); 
+            name := it->name();
             if string.ends_with(name, ".html") {
                 articles << string.temp_copy(name[0 .. name.length-5]);
             }
         }
 
-        res->render("news", ^.{
+        res->render("pages/news", &.{
             articles = articles
         });
     }
@@ -58,12 +63,12 @@ main :: () {
     reg = otmp.registry();
     reg->load_directory("./www/templates", ".html");
 
-    app := http.application();
+    app := http.server.application();
 
-    http.set_mime_type("svg", "image/svg+xml");
+    http.server.set_mime_type("svg", "image/svg+xml");
 
-    files := http.static("/static/", "./www/static/");
-    app->pipe(^files);
+    files := http.server.static("/static/", "./www/static/");
+    app->pipe(&files);
 
     #if #defined(runtime.vars.Debug) {
         app->pipe((req, res) => {
@@ -71,18 +76,18 @@ main :: () {
         });
     }
 
-    router := http.router();
+    router := http.server.router();
     router->collect_routes();
-    app->pipe(^router);
+    app->pipe(&router);
 
     app->pipe((req, res) => {
         if !res.completed {
-            res->render("404", null);
+            res->render("pages/404", null);
         }
     });
 
-    logger := http.logger();
-    app->pipe(^logger);
+    logger := http.server.logger();
+    app->pipe(&logger);
 
     app->serve(8080);
     println("Server stopping...");
index 4ee63a839967f993b5c62384fc23d675f8d5314c..5d9af0035e34f5eece9b345dc22f46c6598695c6 100644 (file)
@@ -167,11 +167,23 @@ navbar a {
     flex-direction: row;
     justify-content: space-between;
     width: 100%;
+    gap: 24px;
 }
 
 .panel-container div {
     flex-basis: 0;
-    min-width: 200px;
-    padding: 6px 0;
-    /* background-color: var(--background-color); */
-}
\ No newline at end of file
+    flex-grow: 1;
+
+    padding: 12px 0;
+/*    background-color: var(--background-color);*/
+}
+
+.panel-container div h3 {
+    margin-bottom: 4px;
+}
+
+.panel-container div p {
+    width: 100%;
+    text-align: justify;
+}
+
index 93c70a6ca3a5fe19781beda029d150020895ed90..e59d5b904d69ae8fad08d3afeb596fd3e2eaed3b 100644 (file)
@@ -2,12 +2,12 @@
 <!-- Created with Inkscape (http://www.inkscape.org/) -->
 
 <svg
-   width="48"
-   height="48"
-   viewBox="0 0 12.7 12.7"
+   width="50"
+   height="50"
+   viewBox="0 0 13.229166 13.229166"
    version="1.1"
    id="svg5"
-   inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
+   inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
    sodipodi:docname="logo.svg"
    inkscape:export-filename="C:\dev\onyx\docs\logos\logo.png"
    inkscape:export-xdpi="512"
      inkscape:pagecheckerboard="1"
      inkscape:document-units="mm"
      showgrid="false"
-     inkscape:zoom="8.7988366"
-     inkscape:cx="23.866792"
-     inkscape:cy="33.243031"
+     inkscape:zoom="4"
+     inkscape:cx="-13.375"
+     inkscape:cy="-41.125"
      inkscape:window-width="1920"
-     inkscape:window-height="1057"
-     inkscape:window-x="1920"
+     inkscape:window-height="1080"
+     inkscape:window-x="0"
      inkscape:window-y="0"
      inkscape:window-maximized="1"
      inkscape:current-layer="layer1"
-     units="px" />
+     units="px"
+     width="49px" />
   <defs
-     id="defs2" />
+     id="defs2">
+    <inkscape:path-effect
+       effect="fillet_chamfer"
+       id="path-effect356"
+       is_visible="true"
+       lpeversion="1"
+       satellites_param="F,1,0,1,0,0.05,0,1 @ F,1,0,1,0,0.05,0,1 @ F,1,0,1,0,0.05,0,1 @ F,1,0,1,0,0.05,0,1 @ F,1,0,1,0,0.05,0,1 @ F,1,0,1,0,0.05,0,1"
+       unit="px"
+       method="auto"
+       mode="F"
+       radius="5"
+       chamfer_steps="1"
+       flexible="true"
+       use_knot_distance="true"
+       apply_no_radius="true"
+       apply_with_radius="true"
+       only_selected="false"
+       hide_knots="false" />
+    <inkscape:path-effect
+       effect="fillet_chamfer"
+       id="path-effect1236"
+       is_visible="true"
+       lpeversion="1"
+       satellites_param="F,1,0,1,0,0.03,0,1 @ F,1,0,1,0,0.03,0,1 @ F,1,0,1,0,0.03,0,1"
+       unit="px"
+       method="auto"
+       mode="F"
+       radius="3"
+       chamfer_steps="1"
+       flexible="true"
+       use_knot_distance="true"
+       apply_no_radius="true"
+       apply_with_radius="true"
+       only_selected="false"
+       hide_knots="false" />
+    <inkscape:path-effect
+       effect="fillet_chamfer"
+       id="path-effect1196"
+       is_visible="true"
+       lpeversion="1"
+       satellites_param="F,1,0,1,0,0.03,0,1 @ F,1,0,1,0,0.03,0,1 @ F,1,0,1,0,0.03,0,1"
+       unit="px"
+       method="auto"
+       mode="F"
+       radius="3"
+       chamfer_steps="1"
+       flexible="true"
+       use_knot_distance="true"
+       apply_no_radius="true"
+       apply_with_radius="true"
+       only_selected="false"
+       hide_knots="false" />
+    <inkscape:path-effect
+       effect="fillet_chamfer"
+       id="path-effect1194"
+       is_visible="true"
+       lpeversion="1"
+       satellites_param="F,1,0,1,0,0.03,0,1 @ F,1,0,1,0,0.03,0,1 @ F,1,0,1,0,0.03,0,1"
+       unit="px"
+       method="auto"
+       mode="F"
+       radius="3"
+       chamfer_steps="1"
+       flexible="true"
+       use_knot_distance="true"
+       apply_no_radius="true"
+       apply_with_radius="true"
+       only_selected="false"
+       hide_knots="false" />
+    <inkscape:path-effect
+       effect="fillet_chamfer"
+       id="path-effect1192"
+       is_visible="true"
+       lpeversion="1"
+       satellites_param="F,1,0,1,0,0.03,0,1 @ F,1,0,1,0,0.03,0,1 @ F,1,0,1,0,0.03,0,1"
+       unit="px"
+       method="auto"
+       mode="F"
+       radius="3"
+       chamfer_steps="1"
+       flexible="true"
+       use_knot_distance="true"
+       apply_no_radius="true"
+       apply_with_radius="true"
+       only_selected="false"
+       hide_knots="false" />
+  </defs>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="Layer 2">
+    <path
+       sodipodi:type="star"
+       style="stroke-width:0.109606"
+       id="path274"
+       inkscape:flatsided="true"
+       sodipodi:sides="6"
+       sodipodi:cx="-55.606628"
+       sodipodi:cy="-32.604942"
+       sodipodi:r1="22.010323"
+       sodipodi:r2="19.061499"
+       sodipodi:arg1="-0.52359878"
+       sodipodi:arg2="0"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="m -36.54513,-42.509588 0,19.809291 a 1.9061498,1.9061498 120 0 1 -0.953075,1.650774 l -17.155348,9.904645 a 1.9061498,1.9061498 180 0 1 -1.90615,0 l -17.155349,-9.904645 a 1.9061498,1.9061498 60 0 1 -0.953075,-1.650774 l 0,-19.80929 a 1.9061498,1.9061498 120 0 1 0.953075,-1.650775 l 17.155349,-9.904645 a 1.9061498,1.9061498 180 0 1 1.906149,0 l 17.155349,9.904645 a 1.9061498,1.9061498 60 0 1 0.953075,1.650774 z"
+       transform="matrix(0.30740531,0,0,0.30372816,23.782897,16.545361)"
+       inkscape:path-effect="#path-effect356" />
+  </g>
   <g
      inkscape:label="Layer 1"
      inkscape:groupmode="layer"
      id="layer1">
     <path
        id="path31"
-       style="fill:#4d4d4d;fill-rule:evenodd;stroke-width:0.112294"
-       d="M 44.603516 12.058594 L 3.2539062 35.931641 L 23.929688 47.869141 L 44.603516 12.058594 z "
-       transform="scale(0.26458333)" />
+       style="fill:#4d4d4d;fill-rule:evenodd;stroke-width:0.0293746"
+       d="M 11.763289,3.914572 1.3881028,9.8522703 a 0.10746311,0.10746311 90.000426 0 0 -1.4e-6,0.1865377 l 4.9883072,2.854897 A 0.32624697,0.32624697 164.99998 0 0 6.8203814,12.774742 L 11.900221,4.0525466 A 0.10062399,0.10062399 45.217132 0 0 11.763289,3.914572 Z"
+       inkscape:path-effect="#path-effect1196"
+       inkscape:original-d="M 12.089211,3.7280473 1.2251325,9.9455378 6.6574279,13.054537 Z" />
     <path
        id="path537"
-       style="fill:#333333;fill-rule:evenodd;stroke-width:0.112294"
-       d="M 44.603516 12.058594 L 23.929688 47.869141 L 44.603516 35.931641 L 44.603516 12.058594 z "
-       transform="scale(0.26458333)" />
+       style="fill:#333333;fill-rule:evenodd;stroke-width:0.029419"
+       d="M 12.162827,4.0018649 6.9729475,12.886067 a 0.0504192,0.0504192 45.290639 0 0 0.068524,0.06922 l 5.1227994,-2.923284 a 0.32119605,0.32119605 120.14455 0 0 0.162004,-0.2789709 l 0,-5.7069276 a 0.08771164,0.08771164 15.146085 0 0 -0.163448,-0.044243 z"
+       inkscape:path-effect="#path-effect1236"
+       inkscape:original-d="M 12.326275,3.7220702 6.8780241,13.04856 12.326275,9.9395598 Z" />
     <path
        id="path1180"
-       style="fill:#999999;fill-rule:evenodd;stroke-width:0.029711"
-       d="M 0.86089959,3.1905755 V 9.5071294 L 11.801522,3.1905755 Z" />
+       style="fill:#999999;fill-rule:evenodd;stroke-width:0.0295315"
+       d="m 1.0890783,3.6985577 v 5.6525366 a 0.22068576,0.22068576 30.240095 0 0 0.329423,0.1920375 L 11.783187,3.6743435 a 0.08679074,0.08679074 75.240095 0 0 -0.04276,-0.1623148 l -10.4648157,0 a 0.18652896,0.18652896 135 0 0 -0.186529,0.186529 z"
+       inkscape:path-effect="#path-effect1194"
+       inkscape:original-d="M 1.0890783,3.5120287 V 9.7296608 L 12.069846,3.5120287 Z" />
     <path
        id="path1062"
-       style="fill:#4d4d4d;fill-rule:evenodd;stroke-width:0.029711"
-       d="M 6.3312107,0.03226975 0.86089912,3.1905759 H 11.801522 Z" />
+       style="fill:#4d4d4d;fill-rule:evenodd;stroke-width:0.029571"
+       d="M 6.4864206,0.28046515 1.4340775,3.1336232 a 0.08682156,0.08682156 75.272862 0 0 0.042693,0.1624213 H 11.967016 a 0.04985456,0.04985456 104.72714 0 0 0.02452,-0.093265 L 6.8167272,0.28046515 a 0.33586257,0.33586257 6.6844583e-7 0 0 -0.3303066,0 z"
+       inkscape:path-effect="#path-effect1192"
+       inkscape:original-d="M 6.6515739,0.18719981 1.1464635,3.2960445 H 12.156684 Z" />
+    <path
+       sodipodi:type="star"
+       style="fill:#ffffff;stroke-width:0.109606"
+       id="path67"
+       inkscape:flatsided="true"
+       sodipodi:sides="6"
+       sodipodi:cx="45.221252"
+       sodipodi:cy="12.972534"
+       sodipodi:r1="1.2606206"
+       sodipodi:r2="1.0917295"
+       sodipodi:arg1="0.53746348"
+       sodipodi:arg2="1.0610623"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="m 46.304138,13.61792 -1.100363,0.615114 -1.082886,-0.645386 0.01748,-1.2605 1.100363,-0.615113 1.082886,0.645385 z"
+       transform="matrix(0.14795386,0,0,0.14795386,5.4827192,1.6710591)" />
   </g>
 </svg>
index d5ed672e7b573b04fd9ee918a49da6f3f60757f2..0d5307b6f1d1f64168ff9e402acd81dc7e5080e7 100644 (file)
@@ -1,15 +1,15 @@
 {{block "content"}}
 
-{% partial "navbar" %}
+{% partial "partials/navbar" %}
 
 <main>
     <div class="container">
         <h1>404 - Page not found</h1>
     </div>
 
-    {% partial "footer" %}
+    {% partial "partials/footer" %}
 </main>
 
 {{endblock}}
 
-{{extends "base"}}
\ No newline at end of file
+{{extends "pages/base"}}
index 9addbe810fc1b0628843983d3da68c0aed622a5c..2282374d3ea8cf40b9f0ea4e46cb27be385de89e 100644 (file)
@@ -1,11 +1,18 @@
-{{block "content"}}
+{{block "page_content"}}
 
-{% partial "navbar" %}
+<div class="container">
+    <h1>Onyx Docs</h1>
 
-<main>
-    {% partial "footer" %}
-</main>
+    <ul>
+        <li><a href="/docs/install">Installation</a></li>
+        <li>Getting Started</li>
+        <li>Language Reference</li>
+        <li>Useful Packages</li>
+    </ul>
+    
+</div>
 
 {{endblock}}
 
-{{extends "base"}}
\ No newline at end of file
+{{extends "pages/normal_page"}}
+
diff --git a/www/templates/pages/docs/getting_started.html b/www/templates/pages/docs/getting_started.html
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/www/templates/pages/docs/install.html b/www/templates/pages/docs/install.html
new file mode 100644 (file)
index 0000000..cf3233b
--- /dev/null
@@ -0,0 +1,30 @@
+{{ block "page_content" }}
+
+<div class="container">
+    <h1>Installing Onyx</h1>
+</div>
+
+<div class="container light">
+    <h2>Try Online</h2>
+    <p>
+        Onyx is available to try online for free in <a href="/playground/">Onyx Playground</a>.
+        It allows you learn the syntax from examples, without installing the language.
+    </p>
+</div>
+
+<div class="container">
+    <h2>Linux</h2>
+</div>
+
+<div class="container">
+    <h2>Windows</h2>
+</div>
+
+<div class="container">
+    <h2>MacOS</h2>
+</div>
+
+
+{{ endblock }}
+
+{{ extends "pages/normal_page" }}
diff --git a/www/templates/pages/docs/reference.html b/www/templates/pages/docs/reference.html
new file mode 100644 (file)
index 0000000..e69de29
index e55aa55cba1a453e6035c547b1f5a19d4a7ca48a..2738a2a82c72fb9ed0bd6d313f014bcdca3ed8af 100644 (file)
@@ -1,31 +1,28 @@
-{{block "content"}}
-
-{% partial "navbar" %}
+{{block "page_content"}}
 
 <div class="container center" style="margin: 0 auto">
 <h1>The <b>Onyx</b> Programming Language</h1>
 </div>
 
 <div class="container light center" style="font-size: 24pt">
-<p><b>Onyx</b> is a data-oriented, safe, and modern programming language for application development.</p>
+<p><b>Onyx</b> is a data-oriented, safe, and modern programming language for application development</p>
 </div>
 
-<main>
-    <div class="container">
-    <div style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
-        <div>
-            <h2>Overview</h2>
-            <br />
-
-            <ul style="font-size: larger;">
-                <li>Runs everywhere using <a href="https://webassembly.org">WebAssembly</a></li>
-                <li>Fast compilation times (300,000+ lines / second)</li>
-                <li>Self-hosted, debuggable runtime using <a href="/ovmwasm">OVM-Wasm</a></li>
-                <li>Secure runtime using <a href="https://wasmer.io">Wasmer</a></li>
-            </ul>
-        </div>
+<div class="container">
+<div style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
+    <div>
+        <h2>Overview</h2>
+        <br />
+
+        <ul style="font-size: larger;">
+            <li>Runs everywhere using <a href="https://webassembly.org">WebAssembly</a></li>
+            <li>Fast compilation times (300,000+ lines / second)</li>
+            <li>Self-hosted, debuggable runtime using <a href="/ovmwasm">OVM-Wasm</a></li>
+            <li>Secure runtime using <a href="https://wasmer.io">Wasmer</a></li>
+        </ul>
+    </div>
 
-        <pre class="hljs" style="overflow-y: scroll; width: 40%; border: 2px solid black; padding: 8px; display: block"><code class="language-onyx">use core
+    <pre class="hljs" style="overflow-y: scroll; width: 40%; border: 2px solid black; padding: 8px; display: block"><code class="language-onyx">use core
 
 main :: () {
     f := factorial(10);
@@ -39,69 +36,70 @@ factorial :: (n: i32) -> i32 {
 }
 </code></pre>
 
-    </div>
-    </div>
+</div>
+</div>
+
+<div class="container light">
+    <h2 style="margin-bottom: 8px">Features</h2>
 
-    <div class="container light">
-        <h2>Features</h2>
-
-        <div class="panel-container">
-            <div>
-                <h3>Portable</h3>
-            </div>
-            <div>
-                <h3>Simple</h3>
-            </div>
-            <div>
-                <h3>Extensible</h3>
-            </div>
-            <div>
-                <h3>Fun</h3>
-            </div>
+    <div class="panel-container">
+        <div>
+            <h3>Portable</h3>
+            <p>By targetting WASM, Onyx can used in the browser, or natively with a custom runtime.</p>
+        </div>
+        <div>
+            <h3>Data-Oriented</h3>
+            <p>Ditch complicated classes and inheritance. Just focus on modeling the data for your application.</p>
+        </div>
+        <div>
+            <h3>Extensible</h3>
+            <p>With a C binding generation library, a useful C library is just one-step away.</p>
+        </div>
+        <div>
+            <h3>Fun and Safe</h3>
+            <p>Onyx enables programmer expressiveness, while making it easy to write bug-free code.</p>
         </div>
     </div>
+</div>
 
 <!--
-    <div class="container light" id="install">
-    <h2>Installation</h2>
-    <br />
-    <h3>Linux</h3>
+<div class="container light" id="install">
+<h2>Installation</h2>
+<br />
+<h3>Linux</h3>
+    <p>
+        Onyx is developed and tested on a Debian-based Linux system.
+        As I am only one developer, I can only focus on so much. Most of my efforts go towards ensuring Onyx is stable on Linux-based distributions.
+        This does include the Windows Subsystem for Linux (WSL), though that is not thoroughly tested.
+    </p>
+
+
+<div style="padding-left: 24px">
+    <h4>Debian / Ubuntu</h4>
         <p>
-            Onyx is developed and tested on a Debian-based Linux system.
-            As I am only one developer, I can only focus on so much. Most of my efforts go towards ensuring Onyx is stable on Linux-based distributions.
-            This does include the Windows Subsystem for Linux (WSL), though that is not thoroughly tested.
+            Debian and Ubuntu will soon have the option of adding an APT repository for Onyx.
         </p>
 
-
-    <div style="padding-left: 24px">
-        <h4>Debian / Ubuntu</h4>
-            <p>
-                Debian and Ubuntu will soon have the option of adding an APT repository for Onyx.
-            </p>
-
-        <h4>All Others</h4>
-            <p>
-                The best way to install Onyx on a Linux system is through directly cloning the Git repository and building it locally.
-                You may want to configure the variables at the top of <code>settings.sh</code> to suit your environment.
-            </p>
-            <pre class="container light merge" style="margin-top: 8px">
+    <h4>All Others</h4>
+        <p>
+            The best way to install Onyx on a Linux system is through directly cloning the Git repository and building it locally.
+            You may want to configure the variables at the top of <code>settings.sh</code> to suit your environment.
+        </p>
+        <pre class="container light merge" style="margin-top: 8px">
 $ git clone https://github.com/onyx-lang/onyx --depth 1
 $ cd onyx
 $ # Configure the top of `./settings.sh` for your system
 $ ./build.sh</pre>
-    </div>
+</div>
 
-    <h3>Windows</h3>
+<h3>Windows</h3>
 
-    <h3>MacOS</h3>
-        <p>Currently, Onyx is not supported on MacOS.</p>
+<h3>MacOS</h3>
+    <p>Currently, Onyx is not supported on MacOS.</p>
 
-    </div>
+</div>
 -->
 
-    {% partial "footer" %}
-</main>
-
 {{endblock}}
 
-{{extends "base"}}
+{{extends "pages/normal_page"}}
index f16282a8d81724365438ea54fb51401ad960470f..a715cdd438d9f3eb260139d8a15755b5ba573ed3 100644 (file)
@@ -1,23 +1,17 @@
-{{block "content"}}
+{{block "page_content"}}
 
-{% partial "navbar" %}
+<div class="container">
+    <h1>News</h1>
 
-<main>
-    <div class="container">
-        <h1>News</h1>
-
-        <ul>
-            {{ foreach $article in $articles }}
-            <li>
-                <a href="/news?a={% $article %}">{% $article %}</a>
-            </li>
-            {{ endforeach }}
-        </ul>
-    </div>
-
-    {% partial "footer" %}
-</main>
+    <ul>
+        {{ foreach $article in $articles }}
+        <li>
+            <a href="/news?a={% $article %}">{% $article %}</a>
+        </li>
+        {{ endforeach }}
+    </ul>
+</div>
 
 {{endblock}}
 
-{{extends "base"}}
\ No newline at end of file
+{{extends "pages/normal_page"}}
index ac5d491bfdd02d7ea4710b02a24d5e7b254f62b2..e4c63d099fb763391f675a2823b9e5ef99a1a1cc 100644 (file)
@@ -1,15 +1,15 @@
 {{block "content"}}
 
-{% partial "navbar" %}
+{% partial "partials/navbar" %}
 
 <main>
     <div class="container">
         {% $article %}
     </div>
 
-    {% partial "footer" %}
+    {% partial "partials/footer" %}
 </main>
 
 {{endblock}}
 
-{{extends "base"}}
\ No newline at end of file
+{{extends "pages/base"}}
diff --git a/www/templates/pages/normal_page.html b/www/templates/pages/normal_page.html
new file mode 100644 (file)
index 0000000..076e684
--- /dev/null
@@ -0,0 +1,12 @@
+{{block "content"}}
+
+<main>
+{% partial "partials/navbar" %}
+{% block "page_content" %}
+{% partial "partials/footer" %}
+</main>
+
+{{endblock}}
+
+{{extends "pages/base"}}
+
index 146d78ea03d8c1d7047692e0d5b5990e0726a69f..692ea4399bcf66a2192b1003763a82458468f3f6 100644 (file)
@@ -1,7 +1,9 @@
 
 <div class="navbar-container">
     <navbar>
-        <img src="/static/images/logo.svg" width="40" height="40" alt="Logo" />
+        <a href="/">
+            <img src="/static/images/logo.svg" width="40" height="40" alt="Logo" />
+        </a>
 
         <div>
             <a href="/"><span>Home</span></a>