update edit repository

This commit is contained in:
2025-02-28 16:04:04 +07:00
parent 680f763c50
commit 4be6903e8f
10 changed files with 209 additions and 81 deletions
+2 -2
View File
@@ -95,7 +95,7 @@ def make_github_link(app, project, path, line=None, mode="blob"):
urlpath = f"/{app.config.github_user}/{project}/{mode}/{branch}/{path}"
return werkzeug.urls.url_unparse((
'https',
'github.com',
'git.nextzenos.com',
urlpath,
'',
'' if line is None else 'L%d' % line
@@ -112,5 +112,5 @@ def add_doc_link(app, pagename, templatename, context, doctree):
# may be useful in the future
source_suffix = app.config.source_suffix
source_suffix = next(iter(source_suffix))
context['github_link'] = lambda mode='edit': make_github_link(
context['github_link'] = lambda mode='_edit': make_github_link(
app, project=app.config.github_project, path=f'content/{pagename}{source_suffix}', mode=mode)
+2 -2
View File
@@ -116,9 +116,9 @@
{%- block body %} {%- endblock %}
</div>
{%- if github_link and pagename != 'search' and not pagename.startswith('legal') %}
<a href="{{ github_link(mode='edit') }}"
<a href="{{ github_link(mode='_edit') }}"
class="o_git_link d-none d-lg-inline-block">
<i class="i-edit"></i> Edit on GitHub
<i class="i-edit"></i> Edit on Repository
</a>
{%- endif %}
</article>