diff --git a/.eleventy.js b/.eleventy.js index 0e57096..fa819a2 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -9,7 +9,7 @@ module.exports = (config) => { for (let page of pages) { if (page.data.sort) { if (sorted[page.data.sort]) { - sorted.splice(page.data.sort) + sorted.splice(page.data.sort, 0, page) } else { sorted[page.data.sort] = page } @@ -21,25 +21,25 @@ module.exports = (config) => { return sorted.concat(unsorted) }) -// custom filters -config.addFilter("makeLowercase", (value) => { - if (typeof value === 'string' || value instanceof String) { - return value.toLowerCase() - } -}) + // custom filters + config.addFilter("makeLowercase", (value) => { + if (typeof value === 'string' || value instanceof String) { + return value.toLowerCase() + } + }) -// added passthrough for global assets -config.addPassthroughCopy("assets") -// added passthrough for images in their respective folders -config.addPassthroughCopy("_content/**/images/**") + // added passthrough for global assets + config.addPassthroughCopy("assets") + // added passthrough for images in their respective folders + config.addPassthroughCopy("_content/**/images/**") -// reutrn updated config -return { - dir: { - input: "_content", // content - includes: "../_includes", // templates - output: "_site", // rendered site - data: "../_data" // global data files + // reutrn updated config + return { + dir: { + input: "_content", // content + includes: "../_includes", // templates + output: "_site", // rendered site + data: "../_data" // global data files + } } } -} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..8940d7b --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "env": { + "browser": true, + "commonjs": true, + "es2021": false, + "node": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest" + }, + "rules": { + "no-var": "error", + "semi": ["error", "never"], + "quotes": ["error", "single"], + "indent": ["error", 2], + "arrow-spacing": "error", + "array-bracket-spacing": ["error", "always"], + "array-bracket-newline": ["error", "consistent"], + "object-curly-spacing": ["error", "always"], + "object-curly-newline": ["error", { "consistent": true }], + "space-before-blocks": ["error", "always"] + }, + "overrides": [ + { + "files": ["./assets/**/*.js"], + "env": { + "commonjs": false, + "node": false + }, + "parserOptions": { + "sourceType": "module" + } + } + ] +}