diff --git a/README.md b/README.md index 75740f1..33b1e30 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ $> npm run deploy ```shell script # Log in to npm $> npm login +# Build before publishing +$> npm run prepare # Push to npm $> npm publish --access public ``` diff --git a/package-lock.json b/package-lock.json index 6ee9d10..0021d44 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index cece9d6..194fedf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fwdekker/template", - "version": "0.0.20", + "version": "0.0.21", "description": "The base template for pages on fwdekker.com.", "author": "Felix W. Dekker (https://fwdekker.com)", "license": "MIT", @@ -29,8 +29,8 @@ "normalize.css": "^8.0.1" }, "devDependencies": { - "css-loader": "^4.2.0", - "grunt": "^1.2.1", + "css-loader": "^4.3.0", + "grunt": "^1.3.0", "grunt-cli": "^1.3.2", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-watch": "^1.1.0", diff --git a/src/main/js/Template.js b/src/main/js/Template.js index c224c70..5fc9662 100644 --- a/src/main/js/Template.js +++ b/src/main/js/Template.js @@ -110,21 +110,33 @@ export const header = function ({title, description}) { /** * Creates a footer element with the given data. * - * @param [author] {string} the author - * @param [authorURL] {string} the URL to link the author's name to - * @param [license] {string} the type of license - * @param [licenseURL] {string} the URL to the license file - * @param [vcs] {string} the type of version control - * @param [vcsURL] {string} the URL to the repository - * @param [version] {string} the page version + * @param [author] {string|undefined} the author + * @param [authorURL] {string|undefined} the URL to link the author's name to + * @param [license] {string|undefined} the type of license + * @param [licenseURL] {string|undefined} the URL to the license file + * @param [vcs] {string|undefined} the type of version control + * @param [vcsURL] {string|undefined} the URL to the repository + * @param [version] {string|undefined} the page version + * @param [privacyPolicyURL] {string|null|undefined} the URL to the privacy policy, or `null` if there should be no + * privacy policy, or `undefined` if the default privacy policy should be used * @returns {HTMLElement} a footer element */ -export const footer = function ({author, authorURL, license, licenseURL, vcs, vcsURL, version}) { +export const footer = function ( + { + author, authorURL, license, licenseURL, vcs, vcsURL, version, + privacyPolicyURL = undefined + }) { return h("footer.footer", h("section.container", footerLink("Made by ", author, authorURL, ". "), footerLink("Licensed under the ", license, licenseURL, ". "), footerLink("Source code available on ", vcs, vcsURL, ". "), + footerLink( + "Consider reading the ", + privacyPolicyURL === null ? undefined : "privacy policy", + privacyPolicyURL === undefined ? "https://fwdekker.com/privacy/" : privacyPolicyURL, + ". " + ), h("div", version || "", {style: {"float": "right"}}) ) );