Browse Source

Make header title optional

master v0.0.14
F.W. Dekker 1 year ago
parent
commit
e094cdcfa6
Signed by: FWDekker GPG Key ID: B1B567AF58D6EE0F
  1. 2418
      package-lock.json
  2. 7
      package.json
  3. 4
      src/main/js/Template.js

2418
package-lock.json

File diff suppressed because it is too large

7
package.json

@ -1,6 +1,6 @@
{
"name": "@fwdekker/template",
"version": "0.0.13",
"version": "0.0.14",
"description": "The base template for pages on fwdekker.com.",
"author": "Felix W. Dekker (https://fwdekker.com)",
"license": "MIT",
@ -21,7 +21,8 @@
"dependencies": {
"hyperscript": "^2.0.2",
"milligram": "^1.3.0",
"normalize.css": "^8.0.1"
"normalize.css": "^8.0.1",
"npm-check-updates": "^6.0.1"
},
"devDependencies": {
"css-loader": "^3.5.3",
@ -31,7 +32,7 @@
"grunt-focus": "^1.0.0",
"grunt-webpack": "^3.1.3",
"style-loader": "^1.2.1",
"webpack": "^4.42.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
}

4
src/main/js/Template.js

@ -77,14 +77,14 @@ const unpackEntry = function (entry) {
/**
* Creates a header element with the given title and description.
*
* @param title {string} the title to display, possibly including HTML
* @param [title] {string} the title to display, possibly including HTML
* @param [description] {string} the description to display, possibly including HTML
* @returns {HTMLElement} a header element
*/
export const header = function ({title, description}) {
return h("header.header",
h("section.container",
h("h1", {innerHTML: title}),
title !== undefined ? h("h1", {innerHTML: title}) : undefined,
description !== undefined ? h("p", h("em", {innerHTML: description})) : undefined
)
);

Loading…
Cancel
Save