nitter/src/views/about.nim

27 lines
772 B
Nim
Raw Normal View History

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