From ce2601642bd752b90ca58a5509f334214dbb67e9 Mon Sep 17 00:00:00 2001 From: Wolvan Date: Wed, 12 Jan 2022 19:53:19 +0100 Subject: [PATCH] Add version of software to footer The version also includes a link to the github repo tag of that version's release build. --- frontend/html/index.html | 2 +- frontend/html/poll.html | 2 +- frontend/html/result.html | 2 +- frontend/static/css/main.css | 4 ++++ src/frontend.ts | 10 +++++++++- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/html/index.html b/frontend/html/index.html index 42777fc..5508b0c 100644 --- a/frontend/html/index.html +++ b/frontend/html/index.html @@ -56,7 +56,7 @@ - + \ No newline at end of file diff --git a/frontend/html/poll.html b/frontend/html/poll.html index ca51be6..6e8f701 100644 --- a/frontend/html/poll.html +++ b/frontend/html/poll.html @@ -54,7 +54,7 @@ - + \ No newline at end of file diff --git a/frontend/html/result.html b/frontend/html/result.html index 81e260e..1826a76 100644 --- a/frontend/html/result.html +++ b/frontend/html/result.html @@ -43,7 +43,7 @@ - + \ No newline at end of file diff --git a/frontend/static/css/main.css b/frontend/static/css/main.css index 6c55b9c..e7dbd4c 100644 --- a/frontend/static/css/main.css +++ b/frontend/static/css/main.css @@ -248,4 +248,8 @@ footer .copyright { color: #fff; padding: 5px; } +footer .copyright a { + color: #fff; + text-decoration: none; +} /* #endregion Footer */ \ No newline at end of file diff --git a/src/frontend.ts b/src/frontend.ts index d7cb397..54d8c5d 100644 --- a/src/frontend.ts +++ b/src/frontend.ts @@ -61,7 +61,15 @@ const defaultReplacements = {
  • Github Repo
  • /mppp/ - Mass Production plushies
  • Pon3.Stream
  • - ` + `, + "SYSTEM_VERSION": ((): string => { + try { + const packageJson = JSON.parse(fs.readFileSync(resolve(__dirname, "../package.json"), "utf8")); + return packageJson.version; + } catch (error) { + return "0.0.0"; + } + })() }; class Defaults2RenderTransform extends MinificationTransform { constructor(replacements = {}) {