feat: changed various config files
This commit is contained in:
parent
7c0bc3c9ca
commit
d0f61d0805
|
@ -1,6 +1,3 @@
|
|||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
[*]
|
||||
|
|
21
.eleventy.js
21
.eleventy.js
|
@ -1,4 +1,5 @@
|
|||
const pluginNavigation = require("@11ty/eleventy-navigation")
|
||||
const htmlmin = require("html-minifier");
|
||||
|
||||
module.exports = function (eleventyConfig) {
|
||||
|
||||
|
@ -11,6 +12,22 @@ module.exports = function (eleventyConfig) {
|
|||
"node_modules/chaffle/docs/chaffle.min.js": "javascript/chaffle.min.js",
|
||||
});
|
||||
|
||||
if (process.env.ELEVENTY_ENV == 'prod') {
|
||||
eleventyConfig.addTransform("htmlmin", function (content, outputPath) {
|
||||
// Eleventy 1.0+: use this.inputPath and this.outputPath instead
|
||||
if (outputPath && outputPath.endsWith(".html")) {
|
||||
let minified = htmlmin.minify(content, {
|
||||
useShortDoctype: true,
|
||||
removeComments: true,
|
||||
collapseWhitespace: true
|
||||
});
|
||||
return minified;
|
||||
} else {
|
||||
return content;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
eleventyConfig.addShortcode("year", () => {
|
||||
let year = new Date().getFullYear();
|
||||
return year.toString();
|
||||
|
@ -20,7 +37,9 @@ module.exports = function (eleventyConfig) {
|
|||
dir: {
|
||||
input: "pages"
|
||||
},
|
||||
pathPrefix: '/~fainsil/'
|
||||
dataTemplateEngine: 'njk',
|
||||
htmlTemplateEngine: 'njk',
|
||||
markdownTemplateEngine: 'njk',
|
||||
}
|
||||
|
||||
}
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -2,5 +2,4 @@ node_modules/
|
|||
_site/
|
||||
pages/content/
|
||||
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
*.log
|
||||
|
|
31
package.json
31
package.json
|
@ -1,13 +1,22 @@
|
|||
{
|
||||
"name": "personnal-website",
|
||||
"version": "1.1.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^0.12.1",
|
||||
"@11ty/eleventy-navigation": "^0.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chaffle": "^2.1.0"
|
||||
}
|
||||
"name": "personnal-website",
|
||||
"version": "1.1.0",
|
||||
"author": "Laureηt <laurentfainsin@protonmail.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"watch:sass": "sass --no-source-map --watch src/scss:_site/css",
|
||||
"watch:eleventy": "ELEVENTY_ENV=dev eleventy --serve",
|
||||
"build:sass": "sass --no-source-map src/scss:_site/css",
|
||||
"build:eleventy": "ELEVENTY_ENV=prod eleventy",
|
||||
"start": "npm-run-all build:sass --parallel watch:*",
|
||||
"build": "npm-run-all build:sass build:eleventy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@11ty/eleventy": "^0.12.1",
|
||||
"@11ty/eleventy-navigation": "^0.2.0",
|
||||
"chaffle": "^2.1.0",
|
||||
"html-minifier": "^4.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"sass": "^1.42.1"
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue