|
|
@ -4,7 +4,9 @@ import re |
|
|
|
import json |
|
|
|
import jinja2 |
|
|
|
|
|
|
|
|
|
|
|
STATIC_FOLDER_PATH = './static' # without trailing slash |
|
|
|
WRAPPING_TEMPLATES_DIR = './wrapping-templates' |
|
|
|
|
|
|
|
def API_request(url, pagename): |
|
|
|
""" |
|
|
@ -113,7 +115,7 @@ def save(html, pagename, publication_unfolded): |
|
|
|
if html: |
|
|
|
|
|
|
|
# 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) |
|
|
|
html = template.render(publication_unfolded=publication_unfolded, title=pagename) |
|
|
|
|
|
|
@ -124,7 +126,7 @@ def save(html, pagename, publication_unfolded): |
|
|
|
out.close() |
|
|
|
|
|
|
|
# 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) |
|
|
|
html = template.render(publication_unfolded=publication_unfolded, title=pagename) |
|
|
|
|
|
|
|