release 1.13.2: sticky version link to commit (no Forgejo tag 404)
Version badge href uses src/commit/<sha> for the exact run tree instead of src/tag/vX.Y.Z, which 404s when the tag is not yet on the remote.
This commit is contained in:
parent
1f1277b36a
commit
aa854b034a
5 changed files with 20 additions and 5 deletions
|
|
@ -42,6 +42,7 @@ def ui(lang: str, key: str, **kwargs) -> str:
|
|||
"env_context_empty": "No run header in log",
|
||||
"generated": "generated",
|
||||
"version": "version",
|
||||
"version_tree_link": "open this run’s git tree (commit)",
|
||||
|
||||
"source": "source",
|
||||
"what_monitors": "What this monitors",
|
||||
|
|
@ -134,6 +135,7 @@ def ui(lang: str, key: str, **kwargs) -> str:
|
|||
"env_context_empty": "Pas d'en-tête d'exécution dans le journal",
|
||||
"generated": "généré",
|
||||
"version": "version",
|
||||
"version_tree_link": "ouvrir l'arbre git de cette exécution (commit)",
|
||||
|
||||
"source": "source",
|
||||
"what_monitors": "Ce que cette page contrôle",
|
||||
|
|
@ -956,9 +958,11 @@ def sticky_bar_html(
|
|||
ver_url = (suite_version_url or "").strip()
|
||||
if ver:
|
||||
if ver_url:
|
||||
# href is usually src/commit/<sha> (exact run tree); label stays vX.Y.Z
|
||||
version_html = (
|
||||
f'<a class="version-link" href="{html.escape(ver_url)}" '
|
||||
f'title="{html.escape(ui(lang, "version"))} {html.escape(ver)}" '
|
||||
f'title="{html.escape(ui(lang, "version"))} {html.escape(ver)}'
|
||||
f' · {html.escape(ui(lang, "version_tree_link"))}" '
|
||||
f'rel="noopener noreferrer">{html.escape(ver)}</a>'
|
||||
)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue