This commit is contained in:
hexlocation's laptop (asiago) 2024-03-29 08:51:20 -04:00
parent f9593d42cc
commit 4ea74c0cb1
4 changed files with 10 additions and 4 deletions

5
config.json Normal file
View file

@ -0,0 +1,5 @@
{
"branding": {
"title": "hexlocation's blog"
}
}

View file

@ -1,5 +1,5 @@
<div id="header-content"> <div id="header-content">
<h1>disseminate</h1> <h1><%= config.branding.title %></h1>
<hr> <hr>
<div id="link-container"> <div id="link-container">
<a href="/">home</a> <a href="/">home</a>

View file

@ -4,6 +4,7 @@ import ejs from "ejs";
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
import jsdom from "jsdom"; import jsdom from "jsdom";
import config from "./config.json"
let app = express(); let app = express();
@ -52,7 +53,7 @@ async function contentScan(){
} }
app.get("/", async (req:express.Request,res:express.Response) => { app.get("/", async (req:express.Request,res:express.Response) => {
res.render("index", {posts: (await contentScan())}) res.render("index", {posts: (await contentScan()), config: config})
}); });
app.use("/post/:post", async (req:express.Request,res:express.Response) => { app.use("/post/:post", async (req:express.Request,res:express.Response) => {
@ -61,7 +62,7 @@ app.use("/post/:post", async (req:express.Request,res:express.Response) => {
let posts = await contentScan(); let posts = await contentScan();
let post = posts.filter(post => post.file === req.params.post) let post = posts.filter(post => post.file === req.params.post)
if(!post[0]) return res.end("404.") if(!post[0]) return res.end("404.")
res.render("post", {posts: posts, post: post[0]}) res.render("post", {posts: posts, post: post[0], config: config})
}) })
app.listen(3024) app.listen(3024)

View file

@ -39,7 +39,7 @@
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
// "resolveJsonModule": true, /* Enable importing .json files. */ "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */