Fix behaviour when no header args are given

This commit is contained in:
Florine W. Dekker 2020-05-17 16:45:46 +02:00
parent e094cdcfa6
commit c25ad1619d
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
4 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,9 @@ const path = require("path");
module.exports = grunt => {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
clean: {
default: ["dist/"],
},
focus: {
dev: {
include: ["css", "js"],
@ -53,6 +56,7 @@ module.exports = grunt => {
},
});
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-focus");
grunt.loadNpmTasks("grunt-webpack");

BIN
package-lock.json generated

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"name": "@fwdekker/template",
"version": "0.0.14",
"version": "0.0.15",
"description": "The base template for pages on fwdekker.com.",
"author": "Felix W. Dekker (https://fwdekker.com)",
"license": "MIT",
@ -14,6 +14,7 @@
},
"browser": "dist/index.js",
"scripts": {
"clean": "grunt clean",
"dev": "grunt dev",
"dev:server": "grunt dev:server",
"deploy": "grunt deploy"
@ -28,6 +29,7 @@
"css-loader": "^3.5.3",
"grunt": "^1.1.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-focus": "^1.0.0",
"grunt-webpack": "^3.1.3",

View File

@ -82,6 +82,9 @@ const unpackEntry = function (entry) {
* @returns {HTMLElement} a header element
*/
export const header = function ({title, description}) {
if (title === undefined && description === undefined)
return h("header.header");
return h("header.header",
h("section.container",
title !== undefined ? h("h1", {innerHTML: title}) : undefined,