From 2d2ea063ac71ec648e71f85ba0cdfc599f94473f Mon Sep 17 00:00:00 2001 From: Ahmed Date: Fri, 19 Jun 2026 20:52:59 +0300 Subject: fix: style --- _shared/build.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to '_shared/build.py') diff --git a/_shared/build.py b/_shared/build.py index a12cd73..a3bd09d 100644 --- a/_shared/build.py +++ b/_shared/build.py @@ -4,8 +4,12 @@ import json import os import sys -def render(title, breadcrumb, style, extra_css, body, footer): +def render(title, breadcrumb, style, extra_css, body, footer, standalone=False): css = style + ("\n" + extra_css if extra_css.strip() else "") + if standalone: + nav = f"" + else: + nav = f'' return f""" @@ -19,7 +23,7 @@ def render(title, breadcrumb, style, extra_css, body, footer):
- +{nav}

{breadcrumb}

@@ -68,6 +72,7 @@ def build(sites_dir): title = site breadcrumb = site + standalone = False meta_file = os.path.join(site_dir, "meta") if os.path.exists(meta_file): for line in open(meta_file): @@ -76,13 +81,15 @@ def build(sites_dir): title = v.strip('"') elif k == "BREADCRUMB": breadcrumb = v.strip('"') + elif k == "STANDALONE": + standalone = v.strip().strip('"') not in ("0", "false", "") extra_css = "" extra_file = os.path.join(site_dir, "extra.css") if os.path.exists(extra_file): extra_css = open(extra_file).read() - out = render(title, breadcrumb, style, extra_css, body, footer) + out = render(title, breadcrumb, style, extra_css, body, footer, standalone=standalone) with open(os.path.join(site_dir, "index.html"), "w") as f: f.write(out) print(f"built: {site}") -- cgit v1.2.3