diff --git a/scripts/generate.py b/scripts/generate.py index b87c5dd..0493f9a 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -25,6 +25,7 @@ EXTENSIONS = [ MIN_HIDDEN_HEADLINE_LEVEL = 2 INDEX_ID = "ea48ec1d-f9d4-4fb7-b39a-faa7b6e2ba95" +SITE_NAME = "Código para llevar" MONITORED_EVENT_TYPES = ( 'IN_CREATE', @@ -123,7 +124,7 @@ def regen_all(src_top, dest_top, docs=None): with open(endpath, "wt") as f: doc_to_headline_remapping['id:' + doc.id] = 'id:' + main_headline.id - f.write(as_document(render(main_headline, doc, headlineLevel=0))) + f.write(as_document(render(main_headline, doc, headlineLevel=0), headline.title)) files_generated += 1 elif doc.id is not None: logging.error("Cannot render document from id: {}. {} headlines {} related".format( @@ -175,13 +176,13 @@ def regen_all(src_top, dest_top, docs=None): } with open(endpath, "wt") as f: - f.write(as_document(render(headline, doc, headlineLevel=0))) + f.write(as_document(render(headline, doc, headlineLevel=0), headline.title)) 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))) + f.write(as_document(render(headline, doc, headlineLevel=0), headline.title)) files_generated += 1 # Update graph, replace document ids with headline ids @@ -386,11 +387,12 @@ def render(headline, doc, headlineLevel): """ -def as_document(html): +def as_document(html, title): return f""" + {title} @ {SITE_NAME}