From 543f65675d5f026a64327509053f9a050ba68736 Mon Sep 17 00:00:00 2001 From: "Felix W. Dekker" Date: Sat, 27 Mar 2021 21:51:01 +0100 Subject: [PATCH] Remove un-minifiable whitespace --- package.json | 2 +- src/main/js/Template.js | 71 +++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 369a826..920fc70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fwdekker/template", - "version": "0.0.24", + "version": "0.0.25", "description": "The base template for pages on fwdekker.com.", "author": "Felix W. Dekker (https://fwdekker.com)", "license": "MIT", diff --git a/src/main/js/Template.js b/src/main/js/Template.js index 8e0b0ff..a7c34ae 100644 --- a/src/main/js/Template.js +++ b/src/main/js/Template.js @@ -51,14 +51,13 @@ export const doAfterLoad = function (fun) { * @returns {HTMLElement} a base navigation element that will eventually be filled with contents */ export const nav = function (highlightPath = "") { - const base = stringToHtml(` - - `, "ul"); + const base = stringToHtml( + ``, + "ul" + ); fetch("https://fwdekker.com/api/nav/") .then(it => it.json()) @@ -93,12 +92,11 @@ const unpackEntry = function (entry, path = "/", highlightPath = "") { const depth = path.split("/").length - 2; // -1 because count parts, then another -1 because of leading `/` const arrow = depth === 0 ? "▾" : "▸"; - return ` -
  • - ${entry.name} ${arrow} - -
  • - `; + return "" + + `
  • ` + + `${entry.name} ${arrow}` + + `` + + `
  • `; }; @@ -113,14 +111,13 @@ export const header = function ({title, description}) { if (title === undefined && description === undefined) return stringToHtml(`
    `, "header"); - return stringToHtml(` -
    -
    - ${(title !== undefined ? `

    ${title}

    ` : "")} - ${(description !== undefined ? `

    ${description}

    ` : "")} -
    -
    - `, "header"); + return stringToHtml( + `
    ` + + (title !== undefined ? `

    ${title}

    ` : "") + + (description !== undefined ? `

    ${description}

    ` : "") + + `
    `, + "header" + ); }; @@ -143,22 +140,20 @@ export const footer = function ( author, authorURL, license, licenseURL, vcs, vcsURL, version, privacyPolicyURL = undefined }) { - return stringToHtml(` - - `, "footer"); + return stringToHtml( + ``, + "footer"); }; /**