From e7a0fdc0b40e1e967c9829f23537492851fee547 Mon Sep 17 00:00:00 2001 From: Mumuni Mohammed Date: Mon, 19 May 2025 16:44:31 +0200 Subject: [PATCH 1/2] feat: included navigation items to header --- _layouts/_includes/header.html | 2 +- app.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/_layouts/_includes/header.html b/_layouts/_includes/header.html index e9a95f2..8b7b58e 100644 --- a/_layouts/_includes/header.html +++ b/_layouts/_includes/header.html @@ -14,7 +14,7 @@

-  {{ t.nav[forloop.index0] }} +  {{ item.text }} {% endfor %} {% if locales | length > 1 %} diff --git a/app.py b/app.py index a3eb4a9..3488584 100644 --- a/app.py +++ b/app.py @@ -1,12 +1,22 @@ from render_engine import Site, Page +navigation = [ + {"text": "Home", "url": "/", "fa": "fa fa-home fa-fw"}, + {"text": "Blog", "url": "/blog/", "fa": "fa fa-newspaper fa-fw"}, + {"text": "About Us", "url": "/about/", "fa": "fa fa-info-circle fa-fw"}, + {"text": "Events", "url": "/events/", "fa": "fa fa-calendar fa-fw"}, + {"text": "Community", "url": "/community/", "fa": "fa fa-users fa-fw"}, + {"text": "Support Us", "url": "/support/", "fa": "fa-solid fa-money-check-dollar"}, +] + app = Site() app.template_path = "_layouts" app.static_paths.add("assets") app.site_vars["locales"] = ["en"] - +app.site_vars["navigation"] = navigation @app.page class Index(Page): template = "index.html" + current = "nav-current" content_path = "index.html" From 45b638ac981b2c882bb3d895f9db399f7dfd7555 Mon Sep 17 00:00:00 2001 From: Mumuni Mohammed Date: Mon, 19 May 2025 17:24:44 +0200 Subject: [PATCH 2/2] fix: navigation urls and nav-current class --- app.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index fe52ba9..0c2d12f 100644 --- a/app.py +++ b/app.py @@ -1,12 +1,12 @@ from render_engine import Site, Page navigation = [ - {"text": "Home", "url": "/", "fa": "fa fa-home fa-fw"}, - {"text": "Blog", "url": "/blog/", "fa": "fa fa-newspaper fa-fw"}, - {"text": "About Us", "url": "/about/", "fa": "fa fa-info-circle fa-fw"}, - {"text": "Events", "url": "/events/", "fa": "fa fa-calendar fa-fw"}, - {"text": "Community", "url": "/community/", "fa": "fa fa-users fa-fw"}, - {"text": "Support Us", "url": "/support/", "fa": "fa-solid fa-money-check-dollar"}, + {"text": "Home", "url": "/index.html", "fa": "fa fa-home fa-fw"}, + {"text": "Blog", "url": "/blog.html", "fa": "fa fa-newspaper fa-fw"}, + {"text": "About Us", "url": "/about.html", "fa": "fa fa-info-circle fa-fw"}, + {"text": "Events", "url": "/events.html", "fa": "fa fa-calendar fa-fw"}, + {"text": "Community", "url": "/community.html", "fa": "fa fa-users fa-fw"}, + {"text": "Support Us", "url": "/support.html", "fa": "fa-solid fa-money-check-dollar"}, ] app = Site() @@ -18,7 +18,6 @@ @app.page class Index(Page): template = "index.html" - current = "nav-current" content_path = "index.html"