From c7ace2fb824ef982b31b1fe8dad312ac83e62c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= <11225821+shaedrich@users.noreply.github.com> Date: Thu, 16 May 2024 11:51:58 +0000 Subject: [PATCH 1/2] Add link to GitHub release/tag/commit in footer --- src/invidious.cr | 1 + src/invidious/views/template.ecr | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index e0bd0101..7b358042 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -78,6 +78,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 9904b4fc..cd50ef4b 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -149,7 +149,22 @@ <%= 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 CONFIG.modified_source_code_url %> + <%= CURRENT_TAG %> + <% else %> + <%= CURRENT_TAG %> + <% end %> + ) + From 4077bdfb982590947191e0d603eeee25c11a07e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= <11225821+shaedrich@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:39:26 +0200 Subject: [PATCH 2/2] Only show tag if there is one Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> --- src/invidious/views/template.ecr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index cd50ef4b..e78c99f5 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -157,6 +157,7 @@ <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> <% end %> @ <%= CURRENT_BRANCH %> + <% if CURRENT_TAG != "" %> ( <% if CONFIG.modified_source_code_url %> <%= CURRENT_TAG %> @@ -164,6 +165,7 @@ <%= CURRENT_TAG %> <% end %> ) + <% end %>