From 994c25de2ec437c0c9c24f9d5d7e982a5811a951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= <11225821+shaedrich@users.noreply.github.com> Date: Sun, 14 Dec 2025 23:30:52 +0100 Subject: [PATCH] Add link to GitHub release/tag/commit in footer (#4702) * Add link to GitHub release/tag/commit in footer * Only show tag if there is one Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> --------- Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> --- src/invidious.cr | 1 + src/invidious/views/template.ecr | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 7fa0725e..4dd5d1dd 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -84,6 +84,7 @@ HTTP_CHUNK_SIZE = 10485760 # ~10MB CURRENT_BRANCH = {{ "#{`git branch | sed -n '/* /s///p'`.strip}" }} CURRENT_COMMIT = {{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit`.strip}" }} CURRENT_VERSION = {{ "#{`git log -1 --format=%ci | awk '{print $1}' | sed s/-/./g`.strip}" }} +CURRENT_TAG = {{ "#{`git tag --points-at HEAD`.strip}" }} # This is used to determine the `?v=` on the end of file URLs (for cache busting). We # only need to expire modified assets, so we can use this to find the last commit that changes diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 9bf33918..0e0f2e16 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -150,7 +150,24 @@ <%= translate(locale, "footer_donate_page") %> - <%= translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> @ <%= CURRENT_BRANCH %> + + <%= translate(locale, "Current version: ") %> + <% if CONFIG.modified_source_code_url %> + <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> + <% else %> + <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> + <% end %> + @ <%= CURRENT_BRANCH %> + <% if CURRENT_TAG != "" %> + ( + <% if CONFIG.modified_source_code_url %> + <%= CURRENT_TAG %> + <% else %> + <%= CURRENT_TAG %> + <% end %> + ) + <% end %> +