From 9a578b3cbb511c7fb3fb166436e8ce790aa6fa77 Mon Sep 17 00:00:00 2001 From: Zed Date: Mon, 3 Jan 2022 08:54:22 +0100 Subject: [PATCH] Improve Nitter version string on about page --- src/views/about.nim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/about.nim b/src/views/about.nim index f30897d..7bf1d0e 100644 --- a/src/views/about.nim +++ b/src/views/about.nim @@ -1,10 +1,12 @@ # SPDX-License-Identifier: AGPL-3.0-only -import karax/[karaxdsl, vdom] -import markdown +import strformat +import karax/[karaxdsl, vdom], markdown const - hash = staticExec("git log -1 --format=\"%h\"") + date = staticExec("git show -s --format=\"%cd\" --date=format:\"%Y.%m.%d\"") + hash = staticExec("git show -s --format=\"%h\"") link = "https://github.com/zedeus/nitter/commit/" & hash + version = &"{date}-{hash}" let about = markdown(readFile("public/md/about.md")) @@ -15,8 +17,8 @@ proc renderAbout*(): VNode = verbatim about h2: text "Instance info" p: - text "Commit " - a(href=link): text hash + text "Version " + a(href=link): text version proc renderFeature*(): VNode = buildHtml(tdiv(class="overlay-panel")):