2021-12-27 02:37:38 +01:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
2022-01-09 23:55:17 +01:00
|
|
|
import os, strformat
|
2022-01-09 23:14:01 +01:00
|
|
|
import karax/[karaxdsl, vdom]
|
2019-09-23 01:42:00 +02:00
|
|
|
|
2019-10-07 17:15:56 +02:00
|
|
|
const
|
2022-01-03 08:54:22 +01:00
|
|
|
date = staticExec("git show -s --format=\"%cd\" --date=format:\"%Y.%m.%d\"")
|
|
|
|
hash = staticExec("git show -s --format=\"%h\"")
|
2019-10-07 17:15:56 +02:00
|
|
|
link = "https://github.com/zedeus/nitter/commit/" & hash
|
2022-01-03 08:54:22 +01:00
|
|
|
version = &"{date}-{hash}"
|
2019-10-07 17:15:56 +02:00
|
|
|
|
2022-01-09 23:48:25 +01:00
|
|
|
var aboutHtml: string
|
|
|
|
|
|
|
|
proc initAboutPage*(dir: string) =
|
2022-01-09 23:14:01 +01:00
|
|
|
try:
|
2022-01-09 23:55:17 +01:00
|
|
|
aboutHtml = readFile(dir/"md/about.html")
|
2022-01-09 23:14:01 +01:00
|
|
|
except IOError:
|
2022-01-09 23:55:17 +01:00
|
|
|
stderr.write (dir/"md/about.html") & " not found, please run `nimble md`\n"
|
2022-01-09 23:48:25 +01:00
|
|
|
aboutHtml = "<h1>About page is missing</h1><br><br>"
|
2019-09-09 04:41:20 +02:00
|
|
|
|
|
|
|
proc renderAbout*(): VNode =
|
2019-09-13 10:44:21 +02:00
|
|
|
buildHtml(tdiv(class="overlay-panel")):
|
2022-01-09 23:48:25 +01:00
|
|
|
verbatim aboutHtml
|
2019-10-07 17:15:56 +02:00
|
|
|
h2: text "Instance info"
|
|
|
|
p:
|
2022-01-03 08:54:22 +01:00
|
|
|
text "Version "
|
|
|
|
a(href=link): text version
|