Remove current_url template variable

Now that the base tag is gone it's not useful anymore

* Make line number links use relative paths
This commit is contained in:
Franciszek Stachura 2024-07-18 14:21:01 +02:00
parent 8cf71f5e62
commit d107fa27aa
3 changed files with 3 additions and 8 deletions

View file

@ -321,7 +321,7 @@ def generate_source(q, path, version, tag, project):
html_code_block = format_code(fname, code)
# Replace line numbers by links to the corresponding line in the current file
html_code_block = sub('href="#-(\d+)', 'name="L\\1" id="L\\1" href="/'+project+'/'+version+'/source'+path+'#L\\1', html_code_block)
html_code_block = sub('href="#-(\d+)', 'name="L\\1" id="L\\1" href="#L\\1', html_code_block)
for f in filters:
if filter_applies(f, path):
@ -427,8 +427,6 @@ def generate_source_page(q, basedir, parsed_path):
data = {
**template_ctx,
'current_url': stringify_source_path(parsed_path),
'current_project': project,
'current_tag': tag,
'current_tag_urlencoded': version,
@ -512,8 +510,6 @@ def generate_ident_page(q, basedir, parsed_path):
title_suffix = project.capitalize()+' source code ('+tag+') - Bootlin'
data = {
'current_url': stringify_ident_path(parsed_path),
'current_project': project,
'current_tag': tag,
'current_tag_urlencoded': version,

View file

@ -34,8 +34,7 @@
<a href="/{{ current_project }}/{{ current_tag_urlencoded }}/source">{{ current_project }}</a>
<em class="icon-tag">{{ current_tag }}</em>
</span>
<a title="Go to top of the page" class="go-top icon-up screenreader"
href="{{ current_url }}#">
<a title="Go to top of the page" class="go-top icon-up screenreader" href="#">
Top
</a>
<span class="poweredby">powered by <a target="_blank" href="https://github.com/bootlin/elixir">Elixir 2.2</a></span>

View file

@ -1,6 +1,6 @@
<header class="topbar">
<div class="breadcrumb">
<a href="{{ current_url }}#menu" class="open-menu icon-menu screenreader" title="Open Menu">Open Menu</a>
<a href="#menu" class="open-menu icon-menu screenreader" title="Open Menu">Open Menu</a>
<a class="project" href="/{{ current_project }}/{{ current_tag_urlencoded }}/source">/</a>
{% for name, url in breadcrumb_links %}
<a href="{{ url }}">{{ name }}</a>