Ensure base can work if invoked not from a page
See the end of the following paragraph:
https://docs.getpelican.com/en/latest/faq.html#can-i-use-arbitrary-metadata-in-my-templates
Also add test to show behaviour with bodytag/notice
diff --git a/content/index2.md b/content/index2.md
new file mode 100644
index 0000000..204fecd
--- /dev/null
+++ b/content/index2.md
@@ -0,0 +1,8 @@
+title: Infrastructure Website Template
+bodytag: id="home"
+notice: Take no notice of this
+
+The **Infrastructure Website Template** assists projects in bootstrapping
+a pelican+buildbot based website.
+
+Test with bodytag and notice/no license
diff --git a/theme/apache/templates/base.html b/theme/apache/templates/base.html
index a4c507a..2f310ff 100644
--- a/theme/apache/templates/base.html
+++ b/theme/apache/templates/base.html
@@ -26,7 +26,9 @@
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
<meta name="theme-color" content="#282661">
+ {% if page %}
<title>{{ page.title }}</title>
+ {% endif %}
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,600" rel="stylesheet">
<link href="/css/min.bootstrap.css" rel="stylesheet">
<link href="/css/styles.css" rel="stylesheet">
@@ -34,12 +36,12 @@
{% include "styles.css" %}
</style>
- {% if page.notice %}<!-- {{ page.notice }} -->{% endif %}
- {% if page.license %}<!-- {{ page.license }} -->{% endif %}
+ {% if page and page.notice %}<!-- {{ page.notice }} -->{% endif %}
+ {% if page and page.license %}<!-- {{ page.license }} -->{% endif %}
</head>
-<body{% if page.bodytag %} {{ page.bodytag }}{% endif %} >
+<body{% if page and page.bodytag %} {{ page.bodytag }}{% endif %} >
<!-- Navigation -->
<header>
<div id="skiptocontent">
@@ -306,10 +308,10 @@
</div>
</header>
<main id="maincontent">
- {% if page.bodytag is not defined %}<div class="container">{% endif %}
+ {% if page and page.bodytag is not defined %}<div class="container">{% endif %}
{% block content %}
{% endblock %}
- {% if page.bodytag is not defined %}</div>{% endif %}
+ {% if page and page.bodytag is not defined %}</div>{% endif %}
</main>
<!-- Footer -->