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 %> + ) +