From 21713e4e61581a5383ef45842a7493e786a28c96 Mon Sep 17 00:00:00 2001 From: Ed Ward Date: Mon, 5 Apr 2021 21:02:53 +0200 Subject: [PATCH] Remove the PDF button if it is not created with the -p / --pdf option --- build.py | 6 ++++++ page-template.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 4424f76..3056faf 100755 --- a/build.py +++ b/build.py @@ -27,6 +27,7 @@ global_screen_template = 'page-template.html' global_onepage_template = 'onepage-template.html' global_pdf_template = 'pdf-template.html' global_master_doc = 'master-doc.txt' +global_pdflink = '' from datetime import datetime global_today_iso = datetime.today().strftime('%Y-%m-%dT%H%M%S') global_today = datetime.today().strftime('%Y-%m-%d') @@ -456,6 +457,11 @@ template = temp.read() temp.close() template = template.replace('{{page.bootstrap_path}}', global_bootstrap_path) template = template.replace('{{page.page_title}}', global_page_title) +if pdf: + template = template.replace('{{page.page_pdflink}}', global_pdflink) +else: + template = template.replace('{{page.page_pdflink}}', '') + # Same as above, but for the "One-Page" version temp = open(global_onepage_template) diff --git a/page-template.html b/page-template.html index 026d0be..cf8506a 100644 --- a/page-template.html +++ b/page-template.html @@ -27,7 +27,7 @@ - + {{page.page_pdflink}}