diff --git a/.eleventy.js b/.eleventy.js index 2da14f9..931b5b4 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,31 +1,19 @@ -const handlebarsPlugin = require("@11ty/eleventy-plugin-handlebars"); - module.exports = async function(eleventyConfig) { - eleventyConfig.addPlugin(handlebarsPlugin); - - // Add a filter using the Config API - // eleventyConfig.addFilter( "myFilter", function() {}); - // Universal Shortcodes (Adds to Liquid, Nunjucks, Handlebars) - eleventyConfig.addShortcode("whichPartial", function(data) { - console.dir(data); - return `${data}`; + eleventyConfig.addShortcode("assetDepth", function() { + const fileName = this.page.filePathStem.split('/').pop(); + return (fileName === 'index') ? '.' : '..'; }); // Copy assets. eleventyConfig.addPassthroughCopy("src/site/images"); eleventyConfig.addPassthroughCopy("src/site/assets"); + eleventyConfig.addPassthroughCopy("src/site/**/*.css"); + eleventyConfig.addPassthroughCopy("src/site/**/*.js"); eleventyConfig.addPassthroughCopy({ "src/site/favico": "/" }); - // Need to manually add watch targets? The CSS wasn't actually - // copying/reloading without this. - // TODO: Maybe instead of having 11ty copy assets into place, I should just - // have my watch process do it, instead? - eleventyConfig.setUseGitIgnore(false); - eleventyConfig.addWatchTarget("src/site/assets"); - // Return Config object. return { dir: { diff --git a/package-lock.json b/package-lock.json index 3c0205a..dfe5f4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,7 @@ "version": "2.0.0", "license": "ISC", "dependencies": { - "@11ty/eleventy": "^3.0.0", - "@11ty/eleventy-plugin-handlebars": "^1.0.0" + "@11ty/eleventy": "^3.0.0" } }, "node_modules/@11ty/dependency-tree": { @@ -147,24 +146,6 @@ "url": "https://opencollective.com/11ty" } }, - "node_modules/@11ty/eleventy-plugin-handlebars": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-handlebars/-/eleventy-plugin-handlebars-1.0.0.tgz", - "integrity": "sha512-LdAqMv5CWcmufl8LB4zCCKyIHcVYnkp0rPHn6RAyJjQAmAi6aRGK7C8RSR5R9SgE2JU9OIowcXdiaJiqFtrGdQ==", - "dependencies": { - "@11ty/eleventy-utils": "^1.0.3", - "debug": "^4.3.5", - "fast-glob": "^3.3.2", - "handlebars": "^4.7.8" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/11ty" - } - }, "node_modules/@11ty/eleventy-utils": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.3.tgz", @@ -1167,27 +1148,6 @@ "node": ">=6.0" } }, - "node_modules/handlebars": { - "version": "4.7.8", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", - "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", - "license": "MIT", - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.2", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, "node_modules/has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", @@ -1657,12 +1617,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "license": "MIT" - }, "node_modules/node-retrieve-globals": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/node-retrieve-globals/-/node-retrieve-globals-6.0.0.tgz", @@ -2134,15 +2088,6 @@ "node": ">=8.0.0" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -2300,19 +2245,6 @@ "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", "license": "MIT" }, - "node_modules/uglify-js": { - "version": "3.19.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", - "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", - "license": "BSD-2-Clause", - "optional": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -2342,12 +2274,6 @@ "node": ">= 8" } }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "license": "MIT" - }, "node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -2582,17 +2508,6 @@ "posthtml-match-helper": "^2.0.2" } }, - "@11ty/eleventy-plugin-handlebars": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-handlebars/-/eleventy-plugin-handlebars-1.0.0.tgz", - "integrity": "sha512-LdAqMv5CWcmufl8LB4zCCKyIHcVYnkp0rPHn6RAyJjQAmAi6aRGK7C8RSR5R9SgE2JU9OIowcXdiaJiqFtrGdQ==", - "requires": { - "@11ty/eleventy-utils": "^1.0.3", - "debug": "^4.3.5", - "fast-glob": "^3.3.2", - "handlebars": "^4.7.8" - } - }, "@11ty/eleventy-utils": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.3.tgz", @@ -3227,18 +3142,6 @@ "strip-bom-string": "^1.0.0" } }, - "handlebars": { - "version": "4.7.8", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", - "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", - "requires": { - "minimist": "^1.2.5", - "neo-async": "^2.6.2", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4", - "wordwrap": "^1.0.0" - } - }, "has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", @@ -3537,11 +3440,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" - }, "node-retrieve-globals": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/node-retrieve-globals/-/node-retrieve-globals-6.0.0.tgz", @@ -3837,11 +3735,6 @@ "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz", "integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==" }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -3946,12 +3839,6 @@ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==" }, - "uglify-js": { - "version": "3.19.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", - "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", - "optional": true - }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -3970,11 +3857,6 @@ "isexe": "^2.0.0" } }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" - }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", diff --git a/package.json b/package.json index 637b953..77dfe54 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "author": "", "license": "ISC", "dependencies": { - "@11ty/eleventy": "^3.0.0", - "@11ty/eleventy-plugin-handlebars": "^1.0.0" + "@11ty/eleventy": "^3.0.0" } } diff --git a/src/site/_includes/bottombar.hbs b/src/site/_includes/bottombar.hbs deleted file mode 100644 index a85c071..0000000 --- a/src/site/_includes/bottombar.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - -
a Naming Things Is Hard thing
+Welcome to Next Page
-Welcome to a Next Page project
+A thing using 11ty that helps you quickly start creating your next page.
-A thing using 11ty to help you create your next page
diff --git a/src/site/sample.hbs b/src/site/sample.hbs deleted file mode 100644 index 32a9966..0000000 --- a/src/site/sample.hbs +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: Sample Page -layout: main -styles: -- sample/sample.css -scripts: -- sample/sample.js ---- - -{{> topbar }} - -A thing using 11ty that helps you quickly start creating your next page.
-Showing how a simple sample page can work.
diff --git a/src/site/sample/index.njk b/src/site/sample/index.njk new file mode 100644 index 0000000..9708b58 --- /dev/null +++ b/src/site/sample/index.njk @@ -0,0 +1,16 @@ +--- +title: Sample Page +layout: main +styles: +- sample/sample.css +scripts: +- sample/sample.js +lstyles: +- lsample.css +lscripts: +- lsample.js +--- + +Showing how a simple sample page can work.