diff --git a/README.md b/README.md index 4c4b88f..cab1ef7 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Create a configuration file with the following structure: [forgejo] hostname= token= +issues_url= [output] dest= diff --git a/build.py b/build.py index a4f0ad3..0ddc329 100755 --- a/build.py +++ b/build.py @@ -107,14 +107,19 @@ def main() -> None: open_bugs_over_time = count_open_bugs(bug_reports) json_data = json.dumps(open_bugs_over_time) + current_open_bug_count = open_bugs_over_time[-1][1] if open_bugs_over_time else 0 + bug_list_url = config.get("forgejo", "issues_url", fallback=f"https://{hostname}/issues") script_dir = os.path.dirname(os.path.abspath(__file__)) template_path = os.path.join(script_dir, "template.html") with open(template_path, "r") as fh: template_html = fh.read() + page_html = template_html.replace("jsonData = []", "jsonData = " + json_data) + page_html = page_html.replace("__OPEN_BUG_COUNT__", str(current_open_bug_count)) + page_html = page_html.replace("__BUG_LIST_URL__", bug_list_url) dest = config.get("output", "dest") with open(dest, "w") as out: - out.write(template_html.replace("jsonData = []", "jsonData = " + json_data)) + out.write(page_html) if __name__ == "__main__": diff --git a/template.html b/template.html index c91701a..721b755 100644 --- a/template.html +++ b/template.html @@ -10,6 +10,10 @@ +

+ Open bugs now: __OPEN_BUG_COUNT__ - + Bug list +