From 399f00a54f2cc4d3ee6db51673e7c52f8b971087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Sat, 20 Aug 2022 13:59:15 +0200 Subject: [PATCH] Add index.html generation. --- scripts/generate.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/generate.py b/scripts/generate.py index 3a6d2f0..37b685b 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -20,6 +20,7 @@ EXTENSIONS = [ ] MIN_HIDDEN_HEADLINE_LEVEL = 2 +INDEX_ID = "ea48ec1d-f9d4-4fb7-b39a-faa7b6e2ba95" def load_all(top_dir_relative): top = os.path.abspath(top_dir_relative) @@ -156,6 +157,12 @@ def main(src_top, dest_top): f.write(as_document(render(headline, doc, headlineLevel=0))) files_generated += 1 + if headline.id == INDEX_ID: + index_endpath = os.path.join(dest_top, "index.html") + with open(index_endpath, "wt") as f: + f.write(as_document(render(headline, doc, headlineLevel=0))) + files_generated += 1 + # Update graph, replace document ids with headline ids for headline_data in graph.values(): for link in headline_data['links']: @@ -318,6 +325,7 @@ def as_document(html): return f""" +