fix custom css loading
[squeep-html-template-helper] / lib / template-helper.js
index c983e80acd44329fc6c516ee874198fc2d2e6e58..c72e0ed348415d2c8adf6f1366b1639330819f65 100644 (file)
@@ -6,6 +6,17 @@
 
 const { lazy } = require('@squeep/lazy-property');
 
+
+/**
+ * Set up expected fields for how we handle error reporting
+ * and whatnot.
+ * @param {Object} ctx
+ */
+const initContext = (ctx) => {
+  ctx.errors = [];
+  ctx.notifications = [];
+}
+
 /**
  * Some fields may have values outside normal dates, handle them here.
  * @param {Date} date
@@ -149,8 +160,8 @@ function htmlHead(pagePathLevel, ctx, options) {
   return `\t<head>
 \t\t<meta charset="utf-8">
 \t\t<meta name="viewport" content="width=device-width,initial-scale=1">
-\t\t<link rel="stylesheet" href="${rootPathPfx}static/theme.css" title="Default">
-\t\t<link rel="stylesheet" href="${rootPathPfx}static/custom.css" title="Site Specific">
+\t\t<link rel="stylesheet" href="${rootPathPfx}static/theme.css">
+\t\t<link rel="stylesheet" href="${rootPathPfx}static/custom.css">
 ${headElements.map((e) => '\t\t' + e).join('\n')}
 \t\t<title>${pageTitle}</title>
 \t</head>`;
@@ -392,6 +403,7 @@ function htmlPage(pagePathLevel, ctx, options, main = []) {
 
 
 module.exports = {
+  initContext,
   dateOrNot,
   dateFormat,
   timeElement,