From d26a88628b9a9243898cdb2609f18bda72caa687 Mon Sep 17 00:00:00 2001 From: rhpidfyre Date: Sun, 2 Mar 2025 17:04:04 -0500 Subject: [PATCH] boiler plating --- src/html/footer.html | 11 ++++++++ src/html/header.html | 14 ++++++++++ src/html/motd.html | 17 ++++++++++++ src/index.ejs | 22 ++++++++++++++++ src/index.html | 61 -------------------------------------------- vite.config.js | 18 +++++++++++++ 6 files changed, 82 insertions(+), 61 deletions(-) create mode 100644 src/html/footer.html create mode 100644 src/html/header.html create mode 100644 src/html/motd.html create mode 100644 src/index.ejs delete mode 100644 src/index.html diff --git a/src/html/footer.html b/src/html/footer.html new file mode 100644 index 0000000..77f69c9 --- /dev/null +++ b/src/html/footer.html @@ -0,0 +1,11 @@ +

00:00:00

+
+

0, 0

+ + +
+ \ No newline at end of file diff --git a/src/html/header.html b/src/html/header.html new file mode 100644 index 0000000..025bb94 --- /dev/null +++ b/src/html/header.html @@ -0,0 +1,14 @@ + +
+ + + +
\ No newline at end of file diff --git a/src/html/motd.html b/src/html/motd.html new file mode 100644 index 0000000..4c1a328 --- /dev/null +++ b/src/html/motd.html @@ -0,0 +1,17 @@ +

Welcome to rhpidfyre.io!

+
+

This is a personal website by rhpidfyre / Brandon.

+

You can find my services here or learn about me.

+
+

You can also contribute or view the source code of my website via the links:

+

<https://git.rhpidfyre.io/rhpidfyre/rhpidfyre.io>.

+

<https://github.com/unixtensor/rhpidfyre.io>.

+
+

You can get started with the command: help

+
+ \ No newline at end of file diff --git a/src/index.ejs b/src/index.ejs new file mode 100644 index 0000000..5b57e19 --- /dev/null +++ b/src/index.ejs @@ -0,0 +1,22 @@ + + + + + + + + rhpidfyre.io + + +
+ <%- inlineHtml("header") %> +
+
+ <%- inlineHtml("motd") %> +
+ + + + \ No newline at end of file diff --git a/src/index.html b/src/index.html deleted file mode 100644 index ac01b1a..0000000 --- a/src/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - rhpidfyre.io - - -
- -
- - - -
-
-
-

Welcome to rhpidfyre.io!

-
-

This is a personal website by rhpidfyre / Brandon.

-

You can find my services here or learn about me.

-
-

You can also contribute or view the source code of my website via the links:

-

<https://git.rhpidfyre.io/rhpidfyre/rhpidfyre.io>.

-

<https://github.com/unixtensor/rhpidfyre.io>.

-
-

You can get started with the command: help

-
- -
- - - - \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 1ebd9a6..b1185ca 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,9 +1,27 @@ import { defineConfig } from 'vite' import { createHtmlPlugin } from 'vite-plugin-html' +import { ViteEjsPlugin } from 'vite-plugin-ejs' + +import fs from "fs" +import path from "path" + +const html_dir = path.join(__dirname, "src", "html") + +function inlineHtml(html_file_name) { + try { + const html_path = path.resolve(path.join(html_dir, html_file_name+".html")) + return fs.readFileSync(html_path, "utf-8") + } catch(read_err) { + return "[INLINE-ERROR], "+read_err + } +} export default defineConfig({ plugins: [ createHtmlPlugin({minify: true}), + ViteEjsPlugin({ + inlineHtml: inlineHtml + }) ], root: "src", build: {