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

BIN
package-lock.json generated

Binary file not shown.

View File

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

View File

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