updated sorting system and added linting
This commit is contained in:
parent
2d33c28f6b
commit
116eb3c867
38
.eleventy.js
38
.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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue