From 12682f063d5b61852238c8f99d535a304d04d5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20Br=C3=BCckmann?= <64bit@posteo.de> Date: Mon, 18 Jan 2021 11:54:04 +0100 Subject: [PATCH] First draft of index.html generation --- fdroidserver/index.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/fdroidserver/index.py b/fdroidserver/index.py index fb62014b..c2d287db 100644 --- a/fdroidserver/index.py +++ b/fdroidserver/index.py @@ -230,6 +230,41 @@ def make_v1(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_ else: json.dump(output, fp, default=_index_encoder_default) + html_name = 'index.html' + html_file = os.path.join(repodir, html_name) + with open(html_file, 'w') as f: + name = repodict["name"] + description = repodict["description"] + f.write(""" + + + + {name} + + + + + + + + + + +

{name}

+
+

+QR: {name} + +{description}
+{details}

+{link} +
+""".format(name=name, +description=description, +details="Currently it serves {} apps. To add it to your F-Droid client, scan the QR code (click it to enlarge) or use this URL:".format(len(output['apps'])), +link=repodict["address"] +)) + if common.options.nosign: logging.debug(_('index-v1 must have a signature, use `fdroid signindex` to create it!')) else: