renaming the wrapping-templates folder

This commit is contained in:
manetta 2021-09-01 13:06:47 +02:00
parent f4441189af
commit 5b7508ce9b
3 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,9 @@ import re
import json import json
import jinja2 import jinja2
STATIC_FOLDER_PATH = './static' # without trailing slash STATIC_FOLDER_PATH = './static' # without trailing slash
WRAPPING_TEMPLATES_DIR = './wrapping-templates'
def API_request(url, pagename): def API_request(url, pagename):
""" """
@ -113,7 +115,7 @@ def save(html, pagename, publication_unfolded):
if html: if html:
# save final page that will be used with PagedJS # save final page that will be used with PagedJS
template_file = open(f'{ STATIC_FOLDER_PATH }/local/template.html').read() template_file = open(f'{ STATIC_FOLDER_PATH }/{ WRAPPING_TEMPLATES_DIR }/template.html').read()
template = jinja2.Template(template_file) template = jinja2.Template(template_file)
html = template.render(publication_unfolded=publication_unfolded, title=pagename) html = template.render(publication_unfolded=publication_unfolded, title=pagename)
@ -124,7 +126,7 @@ def save(html, pagename, publication_unfolded):
out.close() out.close()
# save extra html page for debugging # save extra html page for debugging
template_file = open(f'{ STATIC_FOLDER_PATH }/local/template.inspect.html').read() template_file = open(f'{ STATIC_FOLDER_PATH }/{ WRAPPING_TEMPLATES_DIR }/template.inspect.html').read()
template = jinja2.Template(template_file) template = jinja2.Template(template_file)
html = template.render(publication_unfolded=publication_unfolded, title=pagename) html = template.render(publication_unfolded=publication_unfolded, title=pagename)