aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-04-03 15:26:01 -0400
committerfrosty <gabriel@bwaaa.monster>2026-04-03 15:26:01 -0400
commit627a219bea8029107fcee77fbeea7eb79f0a79b2 (patch)
tree48f3b39bb02853191462e7873cd4beef0fded73d
parentdb02c4cc8028606fa57fd50424491008990ef6fd (diff)
downloadomnisearch-627a219bea8029107fcee77fbeea7eb79f0a79b2.tar.gz
feat: made version on homepage link to repo
-rw-r--r--Makefile3
-rw-r--r--src/Routes/Home.c1
-rw-r--r--src/Utility/Utility.h4
-rw-r--r--static/main.css7
-rw-r--r--templates/home.html2
5 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ecd6585..e57c991 100644
--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,11 @@ PKG_DEPS := libxml-2.0 libcurl openssl
GIT_HASH := $(shell git rev-parse --short HEAD)
GIT_DATE := $(shell git log -1 --format='%ad' --date='format:%y.%m.%d')
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
+GIT_REMOTE := $(shell git remote get-url origin)
VERSION := $(GIT_DATE)+$(GIT_HASH)_$(GIT_BRANCH)
-CFLAGS := -Wall -Wextra -O2 -Isrc -DVERSION='"$(VERSION)"'
+CFLAGS := -Wall -Wextra -O2 -Isrc -DVERSION='"$(VERSION)"' -DGIT_REMOTE='"$(GIT_REMOTE)"'
ifeq ($(UNAME_S),Darwin)
DEP_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKG_DEPS) 2>/dev/null)
diff --git a/src/Routes/Home.c b/src/Routes/Home.c
index 1e5c3df..be9a3d0 100644
--- a/src/Routes/Home.c
+++ b/src/Routes/Home.c
@@ -11,6 +11,7 @@ int home_handler(UrlParams *params) {
TemplateContext ctx = new_context();
context_set(&ctx, "theme", theme);
context_set(&ctx, "version", VERSION);
+ context_set(&ctx, "git_remote", GIT_REMOTE);
beaker_set_locale(&ctx, locale);
char *rendered_html = render_template("home.html", &ctx);
send_response(rendered_html);
diff --git a/src/Utility/Utility.h b/src/Utility/Utility.h
index 8d13306..e00e50c 100644
--- a/src/Utility/Utility.h
+++ b/src/Utility/Utility.h
@@ -7,6 +7,10 @@
#define VERSION "unknown"
#endif
+#ifndef GIT_REMOTE
+#define GIT_REMOTE "https://git.bwaaa.monster/omnisearch"
+#endif
+
#define LINK_FIELD_COUNT 3
int hex_to_int(char c);
diff --git a/static/main.css b/static/main.css
index 2ef60c3..5811468 100644
--- a/static/main.css
+++ b/static/main.css
@@ -145,6 +145,13 @@ img[src=""] {
color: var(--text-muted);
text-align: center;
}
+.version-link {
+ color: var(--text-muted);
+ text-decoration: underline;
+}
+.version-link:hover {
+ color: var(--text-primary);
+}
.nav-settings-icon {
width:24px;
height:24px;
diff --git a/templates/home.html b/templates/home.html
index 0aef27b..65280cf 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -40,7 +40,7 @@
</div>
<a href="/settings" class="home-settings-btn" title="{{l("settings_tab")}}"></a>
<footer class="home-footer">
- <span class="version">{{version}}</span>
+ <a href="{{git_remote}}" class="version-link" target="_blank" rel="noopener noreferrer">{{version}}</a>
</footer>
</body>