to prev and next page, besides that there's :html:`<link rel="prev">` and
:html:`<link rel="next">` that provides the same as a hint to search engines.
+`Pass-through pages`_
+=====================
+
+Besides `pages`_, `articles`_ and `pre-defined pages`_ explained above, where
+the content is always wrapped with the navbar on top and the footer bottom,
+it's possible to have pages with fully custom markup --- for example various
+presentation slides, demos etc. To do that, set the :rst:`:template:` metadata
+to ``passthrough``. While it works with :abbr:`reST <reStructuredText>`
+sources, this is best combined with raw HTML input. Pelican will copy the
+contents of the :html:`<body>` tag verbatim and use contents of the
+:html:`<title>` element for a page title, put again in the :html:`<title>`
+(*not* as a :html:`<h1>` inside :html:`<body>`). Besides that, you can specify
+additional metadata using the :html:`<meta name="key" content="value" />` tags:
+
+- :html:`<meta name="template" content="passthrough" />` needs to be always
+ present in order to make Pelican use the passthrough template.
+- :html:`<meta name="css" />`, :html:`<meta name="js" />` and
+ :html:`<meta name="html_header" />` specify additional CSS files,
+ JavaScript files and arbitrary HTML, similarly as with normal pages. The
+ ``content`` can be multiple lines, empty lines are discarded for CSS and JS
+ references. Be sure to properly escape everything.
+- :html:`<meta name="class" />` can be used to add a CSS class to the
+ top-level :html:`<html>` element
+- All usual Pelican metadata like ``url``, ``slug`` etc. work here as well.
+
+Note that at the moment, the pass-through pages do not insert any of the
+(social) meta tags. Example of an *input* file for a pass-through page:
+
+.. code:: html
+
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+ <title>WebGL Demo Page</title>
+ <meta name="template" content="passthrough" />
+ <meta name="css" content="
+ m-dark.css
+ https://fonts.googleapis.com/css?family=Source+Code+Pro:400,400i,600%7CSource+Sans+Pro:400,400i,600,600i
+ " />
+ <meta name="js" content="webgl-demo.js" />
+ </head>
+ <body>
+ <!-- the actual page body -->
+ </body>
+ </html>
+
`Theme properties`_
===================
--- /dev/null
+<!DOCTYPE html>
+<html lang="en"{% if page.class %} class="{{ page.class }}"{% endif %}>
+<head>
+ <meta charset="UTF-8" />
+ <title>{{ page.title }}</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ {% if page.css %}
+ {% set styles = page.css.strip().split('\n') %}
+ {% for style in styles %}
+ <link rel="stylesheet" href="{{ style.strip()|expand_link(page)|e }}" />
+ {% endfor %}
+ {% endif %}
+ {% if page.js %}
+ {% set scripts = page.js.strip().split('\n') %}
+ {% for script in scripts %}
+ <script src="{{ script.strip()|expand_link(page)|e }}"></script>
+ {% endfor %}
+ {% endif %}
+ {% if page.html_header %}
+ {{ page.html_header.strip()|indent(2) }}
+ {% endif %}
+</head>
+<body>
+{{- page.content -}}
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>WebGL Demo Page</title>
+ <meta name="template" content="passthrough" />
+ <meta name="css" content="
+ a.css
+ b.css
+ " />
+ <meta name="js" content="webgl-demo.js
+ b.js" />
+ <meta name="class" content="a-html-class" />
+ <meta name="html_header" content="
+<!-- extra HTML header content
+ another line -->
+<!-- escaping is annoying -->
+" />
+</head>
+<body>
+<!-- the actual page body -->
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en" class="a-html-class">
+<head>
+ <meta charset="UTF-8" />
+ <title>WebGL Demo Page</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <link rel="stylesheet" href="a.css" />
+ <link rel="stylesheet" href="b.css" />
+ <script src="webgl-demo.js"></script>
+ <script src="b.js"></script>
+ <!-- extra HTML header content
+ another line -->
+ <!-- escaping is annoying -->
+</head>
+<body>
+<!-- the actual page body -->
+</body>
+</html>
# Verify that the social meta tags are present
self.assertEqual(*self.actual_expected_contents('page.html'))
+
+class Passthrough(PageTestCase):
+ def __init__(self, *args, **kwargs):
+ super().__init__(__file__, 'passthrough', *args, **kwargs)
+
+ def test(self):
+ self.run_pelican({
+ 'READERS': {}, # re-enable the HTML reader
+ 'PAGE_PATHS': ['input']
+ })
+
+ self.assertEqual(*self.actual_expected_contents('page.html'))