-
+
+ ${
+ SHOWHEADER &&
+ `
+
+ ${Header({ icon, title })}
- )}
-
- );
+ `;
};
diff --git a/src/shared/is.js b/src/shared/is.js
new file mode 100644
index 0000000..e25da5b
--- /dev/null
+++ b/src/shared/is.js
@@ -0,0 +1,18 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.is = void 0;
+function IsArray(data) {
+ if (data === null || typeof data === "undefined") {
+ return false;
+ }
+ return data.constructor === Array;
+}
+function IsNull(data) {
+ return (typeof data === "undefined" ||
+ data === null ||
+ (typeof data === "string" && data.length === 0) ||
+ (IsArray(data) && data.length === 0));
+}
+exports.is = {
+ null: IsNull,
+};
diff --git a/src/shared/types.js b/src/shared/types.js
new file mode 100644
index 0000000..c8ad2e5
--- /dev/null
+++ b/src/shared/types.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/src/static.js b/src/static.js
index 8b367d2..c57ff63 100644
--- a/src/static.js
+++ b/src/static.js
@@ -38,6 +38,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
Object.defineProperty(exports, "__esModule", { value: true });
var fs = require("fs/promises");
var path = require("path");
+var index_1 = require("./pages/index");
+var variables_1 = require("./variables");
var indexFilePath = path.join(__dirname, "../", "index.html");
function writeIndexPage(contents) {
return __awaiter(this, void 0, void 0, function () {
@@ -99,7 +101,7 @@ function start() {
case 0: return [4 /*yield*/, readIndexPage()];
case 1:
index = _a.sent();
- newText = "
Hello, world!
";
+ newText = (0, index_1.IndexPage)({ icon: variables_1.PAGEICON, title: variables_1.PAGETITLE });
rootDiv = '
';
rootDivReplacement = '
$1
';
newIndex = index.replace(rootDiv, rootDivReplacement.replace("$1", newText));
diff --git a/src/static.ts b/src/static.ts
index 3192897..9a121ca 100644
--- a/src/static.ts
+++ b/src/static.ts
@@ -1,5 +1,7 @@
import * as fs from "fs/promises";
import * as path from "path";
+import { IndexPage } from "./pages/index";
+import { PAGEICON, PAGETITLE } from "./variables";
const indexFilePath = path.join(__dirname, "../", "index.html");
@@ -31,7 +33,7 @@ async function readIndexPage(): Promise
{
async function start(): Promise {
const index = await readIndexPage();
- const newText = "Hello, world!
";
+ const newText = IndexPage({ icon: PAGEICON, title: PAGETITLE });
const rootDiv = '';
const rootDivReplacement = '$1
';
diff --git a/src/variables.js b/src/variables.js
new file mode 100644
index 0000000..fca83ba
--- /dev/null
+++ b/src/variables.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NEWWINDOW = exports.THEME = exports.CATEGORIES = exports.SHOWHEADERTOP = exports.SHOWHEADERLINE = exports.SHOWHEADER = exports.PAGEICON = exports.PAGETITLE = void 0;
+exports.PAGETITLE = "My Website";
+exports.PAGEICON = "/logo.png";
+exports.SHOWHEADER = true;
+exports.SHOWHEADERLINE = true;
+exports.SHOWHEADERTOP = false;
+exports.CATEGORIES = "normal";
+exports.THEME = "light";
+exports.NEWWINDOW = true;
diff --git a/tsconfig.json b/tsconfig.json
index 795e75b..8db37d7 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,7 +5,8 @@
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
+ "resolveJsonModule": true,
"module": "CommonJS"
},
- "include": ["src/*.ts"]
+ "include": ["src"]
}