Skip to content

Commit 0353eda

Browse files
committed
optimise seo
1 parent 8274746 commit 0353eda

File tree

9 files changed

+1287
-156
lines changed

9 files changed

+1287
-156
lines changed

assets/main.bundle.css

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import fs from "fs";
33
import { Edge } from "edge.js";
44
import matter from "gray-matter";
55
import markdownit from "markdown-it";
6+
import purify from "purify-css";
67

78
// Variables / Constants
89
const projectsFolder = "./projects";
@@ -41,6 +42,15 @@ for (const projectFile of projectFiles) {
4142
const html = edge.renderSync("index", { projects });
4243
fs.writeFileSync(`${renderFolder}/index.html`, html, { recursive: true });
4344

45+
// Clean CSS
46+
const css = fs.readFileSync(`assets/main.bundle.css`, { encoding: "utf-8" });
47+
48+
let options = {
49+
output: "public/style.min.css",
50+
minify: true,
51+
};
52+
purify(html, css, options);
53+
4454
// OUTPUT
4555

4656
console.log("WEBSITE GENERATED!");

0 commit comments

Comments
 (0)