'use strict'
const TAG_ALL_RX = /<[^>]+>/g
-module.exports = (html) => html.replace(TAG_ALL_RX, '')
+module.exports = (html) => html && html.replace(TAG_ALL_RX, '')
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>{{detag page.title}}{{#if site.title}} :: {{site.title}}{{/if}}</title>
+ <title>{{detag (or page.title 'Page Not Found')}}{{#if site.title}} :: {{site.title}}{{/if}}</title>
<link rel="stylesheet" href="{{uiRootPath}}/css/site.css">
{{> head}}
</head>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>{{detag page.title}}{{#if site.title}} :: {{site.title}}{{/if}}</title>
+ <title>{{detag (or page.title 'Untitled')}}{{#if site.title}} :: {{site.title}}{{/if}}</title>
{{#if page.canonicalUrl}}
<link rel="canonical" href="{{page.canonicalUrl}}">
{{/if}}
<article class="doc">
+{{#if page.title}}
<h1>{{{page.title}}}</h1>
+{{/if}}
{{{page.contents}}}
</article>