show which template renders a given page

Add a comment to every output page to show which template was used to
render it to help someone trying to change the site figure out which
file to edit.

Change-Id: I08bbfb9bb355d170d9c5bbb085b03b2d54f1aefe
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann
2017-07-08 20:47:53 -04:00
parent 71e278b3b5
commit 924f1d91c8
2 changed files with 5 additions and 1 deletions

View File

@@ -186,7 +186,10 @@ def main():
raise
try:
output = template.render(PROJECT_DATA=project_data)
output = template.render(
PROJECT_DATA=project_data,
TEMPLATE_FILE=templateFile,
)
if templateFile.endswith('.html'):
soup = BeautifulSoup(output, "lxml")
output = soup.prettify()

View File

@@ -2,6 +2,7 @@
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} -->
{% block header %}{% endblock %}
<title>OpenStack Docs: {% block pagetitle %}{% endblock %}</title>
<meta charset="utf-8">