gitsrht/templates: Drop /item/ from forge meta tags

Links with /item/ result in 404s for the root directory. Remove /item/
so that links to the root directory work properly.

For example, this link on godocs.io is broken:
https://godocs.io/git.sr.ht/~sircmpwn/getopt#pkg-files
This commit is contained in:
Adnan Maolood 2023-08-02 16:07:55 -04:00 committed by Drew DeVault
parent 5e5b7b77f0
commit e520aa8a73
1 changed files with 3 additions and 3 deletions

View File

@ -18,10 +18,10 @@
{# Forge meta tags #}
{% set project_root = root + url_for("repo.summary", owner=repo.owner.canonical_name, repo=repo.name) %}
<meta name="forge:summary" content="{{project_root}}">
<meta name="forge:dir" content="{{project_root}}/tree/{ref}/item/{path}">
<meta name="forge:file" content="{{project_root}}/tree/{ref}/item/{path}">
<meta name="forge:dir" content="{{project_root}}/tree/{ref}/{path}">
<meta name="forge:file" content="{{project_root}}/tree/{ref}/{path}">
<meta name="forge:rawfile" content="{{project_root}}/blob/{ref}/{path}">
<meta name="forge:line" content="{{project_root}}/tree/{ref}/item/{path}#L{line}">
<meta name="forge:line" content="{{project_root}}/tree/{ref}/{path}#L{line}">
{# Go meta tags #}
<meta name="go-import" content="{{domain}}/{{owner.canonical_name}}/{{repo.name}} git {{(repo | clone_urls)[0]}}">
{% endblock %}