fuck it inline css
This commit is contained in:
14
.eleventy.js
14
.eleventy.js
@ -1,15 +1,15 @@
|
||||
const htmlmin = require("html-minifier");
|
||||
const rimraf = require("rimraf");
|
||||
|
||||
const cleancss = require("clean-css");
|
||||
|
||||
module.exports = function (eleventyConfig) {
|
||||
rimraf.windows.sync("public/")
|
||||
|
||||
|
||||
eleventyConfig.addPassthroughCopy("./src/_assets/css");
|
||||
eleventyConfig.addPassthroughCopy("./src/_assets/img");
|
||||
eleventyConfig.addPassthroughCopy("./src/_assets/fonts");
|
||||
eleventyConfig.addPassthroughCopy("./src/_assets/js");
|
||||
|
||||
|
||||
eleventyConfig.addCollection("tagsList", function (collectionApi) {
|
||||
const tagsList = new Set();
|
||||
collectionApi.getAll().map(item => {
|
||||
@ -19,9 +19,8 @@ module.exports = function (eleventyConfig) {
|
||||
});
|
||||
return tagsList;
|
||||
});
|
||||
|
||||
|
||||
eleventyConfig.addTransform("htmlmin", function (content) {
|
||||
// Prior to Eleventy 2.0: use this.outputPath instead
|
||||
if (this.page.outputPath && this.page.outputPath.endsWith(".html")) {
|
||||
let minified = htmlmin.minify(content, {
|
||||
useShortDoctype: true,
|
||||
@ -30,10 +29,13 @@ module.exports = function (eleventyConfig) {
|
||||
});
|
||||
return minified;
|
||||
}
|
||||
|
||||
return content;
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter("cssmin", function(code) {
|
||||
return new cleancss({}).minify(code).styles;
|
||||
});
|
||||
|
||||
return {
|
||||
passthroughFileCopy: true,
|
||||
dir: {
|
||||
|
34
package-lock.json
generated
34
package-lock.json
generated
@ -11,6 +11,7 @@
|
||||
"dependencies": {
|
||||
"@11ty/eleventy": "^2.0.0",
|
||||
"bootstrap": "^5.2.3",
|
||||
"clean-css": "^5.3.2",
|
||||
"html-minifier": "^4.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"rimraf": "^4.1.3",
|
||||
@ -534,14 +535,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/clean-css": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz",
|
||||
"integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==",
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz",
|
||||
"integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==",
|
||||
"dependencies": {
|
||||
"source-map": "~0.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4.0"
|
||||
"node": ">= 10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
@ -1261,6 +1262,17 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/html-minifier/node_modules/clean-css": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz",
|
||||
"integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==",
|
||||
"dependencies": {
|
||||
"source-map": "~0.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/html-minifier/node_modules/commander": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
@ -3539,9 +3551,9 @@
|
||||
}
|
||||
},
|
||||
"clean-css": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz",
|
||||
"integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==",
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz",
|
||||
"integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==",
|
||||
"requires": {
|
||||
"source-map": "~0.6.0"
|
||||
}
|
||||
@ -4062,6 +4074,14 @@
|
||||
"uglify-js": "^3.5.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"clean-css": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz",
|
||||
"integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==",
|
||||
"requires": {
|
||||
"source-map": "~0.6.0"
|
||||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
|
@ -13,6 +13,7 @@
|
||||
"dependencies": {
|
||||
"@11ty/eleventy": "^2.0.0",
|
||||
"bootstrap": "^5.2.3",
|
||||
"clean-css": "^5.3.2",
|
||||
"html-minifier": "^4.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"rimraf": "^4.1.3",
|
||||
|
@ -1,12 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta property="og:image" content="/_assets/img/cropped.png" />
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta property="og:image" content="/_assets/img/cropped.png"/>
|
||||
<link rel="icon" type="image/x-icon" href="/_assets/img/fav.png">
|
||||
<link rel="stylesheet" href="/_assets/css/normalize.css" />
|
||||
<link rel="stylesheet" href="/_assets/css/styles.css" />
|
||||
{# <link rel="stylesheet" href="/_assets/css/normalize.css" /> #}
|
||||
<link rel="stylesheet" href="/_assets/css/styles.css"/>
|
||||
|
||||
{% set css %}
|
||||
{% include "styles.css" %}
|
||||
{% endset %}
|
||||
<!-- feed it through our cssmin filter to minify -->
|
||||
<style>
|
||||
{{css | cssmin | safe}}
|
||||
</style>
|
||||
|
||||
{% if title %}
|
||||
<title>{{ site.title }} - {{ title }}</title>
|
||||
{% else %}
|
||||
@ -24,8 +33,8 @@
|
||||
{# <header>{% include 'partials/header.njk' %}</header> #}
|
||||
{# <hr/> #}
|
||||
<article>
|
||||
<h2>{{ title }}</h2>
|
||||
{{ content | safe }}
|
||||
<h2>{{ title }}</h2>
|
||||
{{ content | safe }}
|
||||
</article>
|
||||
</div>
|
||||
<footer>
|
||||
@ -34,8 +43,7 @@
|
||||
</footer>
|
||||
</main>
|
||||
<aside>{% include 'partials/sidebar.njk' %}</aside>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -4,7 +4,7 @@
|
||||
// Bootstrap
|
||||
// @import './vendor/bootstrap'; */
|
||||
|
||||
/* @import './reset.css'; */
|
||||
@import './normalize.css';
|
||||
|
||||
/* / */
|
||||
|
Reference in New Issue
Block a user