use all upper case variables for template vars from generator

Standardize on all upper case variable names so it is easy to tell
local variables in a template apart from global variables set by the
generator.

Change-Id: I69a73b580f1b32547287616c768887732553f9c5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-07-20 15:07:00 -04:00
parent ba9e59454a
commit c1bbe3f43e
13 changed files with 42 additions and 42 deletions

View File

@ -305,11 +305,11 @@ def render_template(environment, project_data, regular_repos, infra_repos,
PAST_SERIES=PAST_SERIES, PAST_SERIES=PAST_SERIES,
RELEASED_SERIES=RELEASED_SERIES, RELEASED_SERIES=RELEASED_SERIES,
SERIES_IN_DEVELOPMENT=SERIES_IN_DEVELOPMENT, SERIES_IN_DEVELOPMENT=SERIES_IN_DEVELOPMENT,
topdir=topdir, TOPDIR=topdir,
scriptdir=scriptdir, SCRIPTDIR=scriptdir,
cssdir=cssdir, CSSDIR=cssdir,
imagedir=imagedir, IMAGEDIR=imagedir,
series=series, SERIES=series,
**extra **extra
) )
if template_file.endswith('.html'): if template_file.endswith('.html'):

View File

@ -4,10 +4,10 @@
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} --> <!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} -->
<!-- CSSDIR: {{ CSSDIR }}-->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>404 Not Found</title> <title>404 Not Found</title>
<!-- CSS in: {{ cssdir }}-->
{% include 'templates/css.tmpl' %} {% include 'templates/css.tmpl' %}
{% block content %} {% block content %}
<!-- Begin Page Content --> <!-- Begin Page Content -->

View File

@ -1,4 +1,4 @@
{% set projects = PROJECT_DATA[series] %} {% set projects = PROJECT_DATA[SERIES] %}
{% extends "templates/base.tmpl" %} {% extends "templates/base.tmpl" %}
{% block pagetitle %}Administrator Guides{% endblock %} {% block pagetitle %}Administrator Guides{% endblock %}
{% block title %} {% block title %}
@ -10,7 +10,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-8 col-sm-8"> <div class="col-lg-8 col-md-8 col-sm-8">
<h1>OpenStack {% if series != 'latest' %}{{series|title}}{% endif %} Administrator Guides</h1> <h1>OpenStack {% if SERIES != 'latest' %}{{SERIES|title}}{% endif %} Administrator Guides</h1>
<p> <p>
This page contains documentation about administering OpenStack services. This page contains documentation about administering OpenStack services.
</p> </p>
@ -25,7 +25,7 @@
<h3><i class="fa fa-book"></i> Administrator Guides for OpenStack Services</h3> <h3><i class="fa fa-book"></i> Administrator Guides for OpenStack Services</h3>
{% for project in projects|sort(attribute='name') -%} {% for project in projects|sort(attribute='name') -%}
{% if project.type in ['service', 'other'] and project.has_admin_guide %} {% if project.type in ['service', 'other'] and project.has_admin_guide %}
<a href="/{{project.name}}/{{series}}/admin/"> <a href="/{{project.name}}/{{SERIES}}/admin/">
{{project.service}} ({{project.name}}) {{project.service}} ({{project.name}})
</a><br /> </a><br />
{% endif %} {% endif %}

View File

@ -1,4 +1,4 @@
{% set projects = PROJECT_DATA[series] %} {% set projects = PROJECT_DATA[SERIES] %}
{% extends "templates/base.tmpl" %} {% extends "templates/base.tmpl" %}
{% block pagetitle %}API references{% endblock %} {% block pagetitle %}API references{% endblock %}
{% block title %}API references{% endblock %} {% block title %}API references{% endblock %}
@ -10,7 +10,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-8 col-sm-8"> <div class="col-lg-8 col-md-8 col-sm-8">
<h1>OpenStack {% if series != 'latest' %}{{series|title}}{% endif %} API Reference Documentation</h1> <h1>OpenStack {% if SERIES != 'latest' %}{{SERIES|title}}{% endif %} API Reference Documentation</h1>
<p> <p>
This page contains documentation about the OpenStack API and how to use it. This page contains documentation about the OpenStack API and how to use it.
</p> </p>
@ -35,7 +35,7 @@
<a href="https://developer.openstack.org/api-ref/{{project.service_type}}/"> API Reference</a> <a href="https://developer.openstack.org/api-ref/{{project.service_type}}/"> API Reference</a>
{% endif %} {% endif %}
{% if project.has_in_tree_api_docs %} {% if project.has_in_tree_api_docs %}
<a href="/{{project.name}}/{{series}}/api/"> API Guide</a> <a href="/{{project.name}}/{{SERIES}}/api/"> API Guide</a>
{% endif %} {% endif %}
{% if project.has_api_guide %} {% if project.has_api_guide %}
<a href="https://developer.openstack.org/api-guide/{{project.service_type}}/"> API Guide</a> <a href="https://developer.openstack.org/api-guide/{{project.service_type}}/"> API Guide</a>

View File

@ -1,4 +1,4 @@
{% set projects = PROJECT_DATA[series] %} {% set projects = PROJECT_DATA[SERIES] %}
{% extends "templates/base.tmpl" %} {% extends "templates/base.tmpl" %}
{% block pagetitle %}Configuration Guides{% endblock %} {% block pagetitle %}Configuration Guides{% endblock %}
{% block title %} {% block title %}
@ -10,7 +10,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-8 col-sm-8"> <div class="col-lg-8 col-md-8 col-sm-8">
<h1>OpenStack {% if series != 'latest' %}{{series|title}}{% endif %} Configuration Guides</h1> <h1>OpenStack {% if SERIES != 'latest' %}{{SERIES|title}}{% endif %} Configuration Guides</h1>
<p> <p>
This page contains documentation about configuring OpenStack services. This page contains documentation about configuring OpenStack services.
</p> </p>
@ -23,12 +23,12 @@
<div class="col-lg-6 col-md-6 col-sm-6"> <div class="col-lg-6 col-md-6 col-sm-6">
<div class="docs-link-sections"> <div class="docs-link-sections">
<h3><i class="fa fa-book"></i> Configuration Guides for OpenStack Services</h3> <h3><i class="fa fa-book"></i> Configuration Guides for OpenStack Services</h3>
<a href="/oslo.config/{{series}}/configuration/"> <a href="/oslo.config/{{SERIES}}/configuration/">
General information about configuring OpenStack (oslo.config) General information about configuring OpenStack (oslo.config)
</a><br /> </a><br />
{% for project in projects|sort(attribute='name') -%} {% for project in projects|sort(attribute='name') -%}
{% if project.type in ['service', 'other'] and project.has_config_ref %} {% if project.type in ['service', 'other'] and project.has_config_ref %}
<a href="/{{project.name}}/{{series}}/configuration/"> <a href="/{{project.name}}/{{SERIES}}/configuration/">
{{project.service}} ({{project.name}}) {{project.service}} ({{project.name}})
</a><br /> </a><br />
{% endif %} {% endif %}

View File

@ -1,4 +1,4 @@
{% set projects = PROJECT_DATA[series] %} {% set projects = PROJECT_DATA[SERIES] %}
{% extends "templates/base.tmpl" %} {% extends "templates/base.tmpl" %}
{% block pagetitle %}Draft Installation Tutorials and Guides{% endblock %} {% block pagetitle %}Draft Installation Tutorials and Guides{% endblock %}
{% block title %} {% block title %}
@ -10,7 +10,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-8 col-sm-8"> <div class="col-lg-8 col-md-8 col-sm-8">
<h1>OpenStack {% if series != 'latest' %}{{series|title}}{% endif %} Installation Tutorials and Guides</h1> <h1>OpenStack {% if SERIES != 'latest' %}{{SERIES|title}}{% endif %} Installation Tutorials and Guides</h1>
<p> <p>
These documents cover installation procedures for OpenStack These documents cover installation procedures for OpenStack
services. services.
@ -47,7 +47,7 @@
{% for project in projects|sort(attribute='service') -%} {% for project in projects|sort(attribute='service') -%}
{% if project.type in ['service', 'other'] and project.has_install_guide %} {% if project.type in ['service', 'other'] and project.has_install_guide %}
<li><a href="/{{project.name}}/{{series}}/install/">{{project.service}} ({{project.name|title}})</a></li> <li><a href="/{{project.name}}/{{SERIES}}/install/">{{project.service}} ({{project.name|title}})</a></li>
{% endif %} {% endif %}
{%- endfor %} {%- endfor %}
</ul> </ul>

View File

@ -1,4 +1,4 @@
{% set projects = PROJECT_DATA[series] %} {% set projects = PROJECT_DATA[SERIES] %}
{% extends "templates/base.tmpl" %} {% extends "templates/base.tmpl" %}
{% block pagetitle %}Language bindings{% endblock %} {% block pagetitle %}Language bindings{% endblock %}
{% block title %} {% block title %}
@ -10,7 +10,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-8 col-sm-8"> <div class="col-lg-8 col-md-8 col-sm-8">
<h1>OpenStack {% if series != 'latest' %}{{series|title}}{% endif %} API Bindings</h1> <h1>OpenStack {% if SERIES != 'latest' %}{{SERIES|title}}{% endif %} API Bindings</h1>
<p> <p>
This page contains documentation about the Python This page contains documentation about the Python
bindings provided by OpenStack and how to use them. bindings provided by OpenStack and how to use them.
@ -26,7 +26,7 @@
<h3><i class="fa fa-book"></i> Bindings for the OpenStack APIs</h3> <h3><i class="fa fa-book"></i> Bindings for the OpenStack APIs</h3>
{% for project in projects|sort(attribute='service') -%} {% for project in projects|sort(attribute='service') -%}
{% if project.type == 'client' %} {% if project.type == 'client' %}
<a href="/{{project.name}}/{{series}}/"> <a href="/{{project.name}}/{{SERIES}}/">
{{project.service}} ({{project.description}}) {{project.service}} ({{project.description}})
</a><br /> </a><br />
{% endif %} {% endif %}
@ -42,7 +42,7 @@
<p> <p>
User guide for the OpenStack dashboard and command-line clients. User guide for the OpenStack dashboard and command-line clients.
</p> </p>
<a href="/python-openstackclient/{{series}}/"> <a href="/python-openstackclient/{{SERIES}}/">
Unified OpenStack Client Unified OpenStack Client
</a><br /> </a><br />
<p> <p>

View File

@ -1,4 +1,4 @@
{% set projects = PROJECT_DATA[series] %} {% set projects = PROJECT_DATA[SERIES] %}
{% extends "templates/base.tmpl" %} {% extends "templates/base.tmpl" %}
{% block pagetitle %}Services and Libraries{% endblock %} {% block pagetitle %}Services and Libraries{% endblock %}
{% block title %} {% block title %}
@ -10,7 +10,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-8 col-sm-8"> <div class="col-lg-8 col-md-8 col-sm-8">
<h1>OpenStack {% if series != 'latest' %}{{series|title}}{% endif %} Projects</h1> <h1>OpenStack {% if SERIES != 'latest' %}{{SERIES|title}}{% endif %} Projects</h1>
<p> <p>
This page contains project-specific documentation for This page contains project-specific documentation for
OpenStack services and libraries. OpenStack services and libraries.

View File

@ -1,4 +1,4 @@
{% set projects = PROJECT_DATA[series] %} {% set projects = PROJECT_DATA[SERIES] %}
{% extends "templates/base.tmpl" %} {% extends "templates/base.tmpl" %}
{% block pagetitle %}User Guides{% endblock %} {% block pagetitle %}User Guides{% endblock %}
{% block title %} {% block title %}
@ -10,7 +10,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-8 col-sm-8"> <div class="col-lg-8 col-md-8 col-sm-8">
<h1>OpenStack {% if series != 'latest' %}{{series|title}}{% endif %} Project User Guides</h1> <h1>OpenStack {% if SERIES != 'latest' %}{{SERIES|title}}{% endif %} Project User Guides</h1>
<p> <p>
This page contains project-specific documentation for This page contains project-specific documentation for
using OpenStack services and libraries. using OpenStack services and libraries.
@ -31,7 +31,7 @@
<h3><i class="fa fa-cog"></i> OpenStack Services</h3> <h3><i class="fa fa-cog"></i> OpenStack Services</h3>
{% for project in projects|sort(attribute='service') %} {% for project in projects|sort(attribute='service') %}
{% if project.type in ['service', 'other'] and project.has_user_guide %} {% if project.type in ['service', 'other'] and project.has_user_guide %}
<a href="/{{project.name}}/{{series}}/user/"> <a href="/{{project.name}}/{{SERIES}}/user/">
{{project.service}} ({{project.name}})</a><br /> {{project.service}} ({{project.name}})</a><br />
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@ -43,7 +43,7 @@
<h3><i class="fa fa-cog"></i> Client Libraries</h3> <h3><i class="fa fa-cog"></i> Client Libraries</h3>
{% for project in projects|sort(attribute='name') %} {% for project in projects|sort(attribute='name') %}
{% if project.type in ['client'] and project.has_user_guide %} {% if project.type in ['client'] and project.has_user_guide %}
<a href="/{{project.name}}/{{series}}/">{{project.name}}</a><br /> <a href="/{{project.name}}/{{SERIES}}/">{{project.name}}</a><br />
<p>{{project.service}} </p> <p>{{project.service}} </p>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -3,12 +3,13 @@
<head> <head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} --> <!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} -->
<!-- SCRIPTDIR: {{SCRIPTDIR}} -->
<!-- CSSDIR: {{CSSDIR}}-->
{% block header %}{% endblock %} {% block header %}{% endblock %}
<title>OpenStack Docs: {% block pagetitle %}{% endblock %}</title> <title>OpenStack Docs: {% block pagetitle %}{% endblock %}</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS in: {{ cssdir }}-->
{% include 'templates/css.tmpl' %} {% include 'templates/css.tmpl' %}
{% include 'templates/google_analytics.tmpl' %} {% include 'templates/google_analytics.tmpl' %}
</head> </head>
@ -16,7 +17,6 @@
{% include 'templates/header.tmpl' %} {% include 'templates/header.tmpl' %}
{% block content %}{% endblock %} {% block content %}{% endblock %}
{% include 'templates/footer.tmpl' %} {% include 'templates/footer.tmpl' %}
<!-- Scripts in: {{ scriptdir }}-->
{% include 'templates/script_footer.tmpl' %} {% include 'templates/script_footer.tmpl' %}
</body> </body>
</html> </html>

View File

@ -1,8 +1,8 @@
<!-- Bootstrap Core CSS --> <!-- Bootstrap Core CSS -->
<link href="{{ cssdir }}bootstrap.css" rel="stylesheet"> <link href="{{ CSSDIR }}bootstrap.css" rel="stylesheet">
<!-- Custom CSS --> <!-- Custom CSS -->
<link href="{{ cssdir }}combined.css" rel="stylesheet"> <link href="{{ CSSDIR }}combined.css" rel="stylesheet">
<!-- Fonts --> <!-- Fonts -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" rel="stylesheet"> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" rel="stylesheet">

View File

@ -3,13 +3,14 @@
<head> <head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} --> <!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} -->
<!-- SCRIPTDIR: {{SCRIPTDIR}} -->
<!-- CSSDIR: {{CSSDIR}}-->
<meta name="google-site-verification" content="Ip5yk0nd8yQHEo8I7SjzVfAiadlHvTvqQHLGwn1GFyU" /> <meta name="google-site-verification" content="Ip5yk0nd8yQHEo8I7SjzVfAiadlHvTvqQHLGwn1GFyU" />
{% block header %}{% endblock %} {% block header %}{% endblock %}
<title>OpenStack Docs: {% block pagetitle %}{% endblock %}</title> <title>OpenStack Docs: {% block pagetitle %}{% endblock %}</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS in: {{ cssdir }}-->
{% include 'templates/css.tmpl' %} {% include 'templates/css.tmpl' %}
{% include 'templates/google_analytics.tmpl' %} {% include 'templates/google_analytics.tmpl' %}
</head> </head>
@ -17,7 +18,6 @@
{% include 'templates/header.tmpl' %} {% include 'templates/header.tmpl' %}
{% block content %}{% endblock %} {% block content %}{% endblock %}
{% include 'templates/footer.tmpl' %} {% include 'templates/footer.tmpl' %}
<!-- Scripts in: {{ scriptdir }}-->
{% include 'templates/script_footer.tmpl' %} {% include 'templates/script_footer.tmpl' %}
</body> </body>
</html> </html>

View File

@ -1,25 +1,25 @@
<!-- jQuery Version 3.1.1 --> <!-- jQuery Version 3.1.1 -->
<script type="text/javascript" src="{{ scriptdir }}jquery-3.1.1.js"></script> <script type="text/javascript" src="{{ SCRIPTDIR }}jquery-3.1.1.js"></script>
<!-- Bootstrap Core JavaScript --> <!-- Bootstrap Core JavaScript -->
<script type="text/javascript" src="{{ scriptdir }}bootstrap.js"></script> <script type="text/javascript" src="{{ SCRIPTDIR }}bootstrap.js"></script>
<!-- The rest of the JS --> <!-- The rest of the JS -->
<script type="text/javascript" src="{{ scriptdir }}navigation.js"></script> <script type="text/javascript" src="{{ SCRIPTDIR }}navigation.js"></script>
<!-- Docs JS --> <!-- Docs JS -->
<script type="text/javascript" src="{{ scriptdir }}docs.js"></script> <script type="text/javascript" src="{{ SCRIPTDIR }}docs.js"></script>
<!-- Popovers --> <!-- Popovers -->
<script type="text/javascript" src="{{ scriptdir }}webui-popover.js"></script> <script type="text/javascript" src="{{ SCRIPTDIR }}webui-popover.js"></script>
<!-- Javascript for page --> <!-- Javascript for page -->
<script type="text/javascript"> <script type="text/javascript">
// Change character image on refresh // Change character image on refresh
// Add file names and captions to doc-characters.json // Add file names and captions to doc-characters.json
$.getJSON("{{ scriptdir }}/doc-characters.json", function(data) { $.getJSON("{{ SCRIPTDIR }}/doc-characters.json", function(data) {
var item = data.images[Math.floor(Math.random()*data.images.length)]; var item = data.images[Math.floor(Math.random()*data.images.length)];
$('<img src="{{ scriptdir }}../images/docs/' + item.image + '">').appendTo('#superuser-img'); $('<img src="{{ SCRIPTDIR }}../images/docs/' + item.image + '">').appendTo('#superuser-img');
$('<p>' + item.caption + '<strong>OpenStack Operator</strong></p>').appendTo('#superuser-img'); $('<p>' + item.caption + '<strong>OpenStack Operator</strong></p>').appendTo('#superuser-img');
}); });
</script> </script>