aboutsummaryrefslogtreecommitdiff
path: root/templates/base.html
diff options
context:
space:
mode:
authorJieiku2023-05-22 23:07:56 -0700
committerJieiku2023-05-22 23:07:56 -0700
commitd9fb3248650404ad6d078eba39b8b91381b1ebed (patch)
tree74f539e18ab82b355c9a5fba542253aa46715579 /templates/base.html
parent236919b4e6ce0c144ca4d5f12ab96a90de2042c2 (diff)
downloadabridge-d9fb3248650404ad6d078eba39b8b91381b1ebed.tar.gz
abridge-d9fb3248650404ad6d078eba39b8b91381b1ebed.tar.bz2
abridge-d9fb3248650404ad6d078eba39b8b91381b1ebed.zip
Fixes for uglyurls
Diffstat (limited to 'templates/base.html')
-rw-r--r--templates/base.html12
1 files changed, 6 insertions, 6 deletions
diff --git a/templates/base.html b/templates/base.html
index 6a6927a..c29fe6e 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -3,7 +3,7 @@
{%- import "macros/page.html" as page_macros %}
{%- import "macros/macros.html" as macros %}
<!DOCTYPE html>
-<html lang="{{ lang }}">
+<html lang="{%- if lang != config.default_language %}{{ lang }}{% else %}{{ config.extra.language_code | default(value=lang) }}{% endif %}">
<head>
{{- macros_head::theme(config=config) }}
{{- macros_head::stylesheets(config=config) }}
@@ -37,16 +37,16 @@
<nav>
<div>
{%- if config.extra.logo -%}
- <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls %}index.html{%- endif %}">
+ <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls %}/index.html{%- endif %}">
{%- if config.extra.logo.file -%}
<img src="{{ config.base_url | safe }}/{{ config.extra.logo.file | safe }}"{%- if config.extra.logo.alt %} alt="{{ config.extra.logo.alt | safe }}"{%- endif %}{%- if config.extra.logo.width %} width="{{ config.extra.logo.width | safe }}"{%- endif %}{%- if config.extra.logo.height %} height="{{ config.extra.logo.height | safe }}"{%- endif %} />
{%- endif -%}
{%- if config.extra.logo.text -%}{{ config.extra.logo.text | safe }}{%- endif -%}
</a></h1>
{%- elif config.extra.textlogo -%}
- <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ config.extra.textlogo | safe }}</a></h1>
+ <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls %}/index.html{%- endif %}">{{ config.extra.textlogo | safe }}</a></h1>
{%- elif config.title -%}
- <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ config.title | safe }}</a></h1>
+ <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls %}/index.html{%- endif %}">{{ config.title | safe }}</a></h1>
{%- endif -%}
</div>
<div>
@@ -75,9 +75,9 @@
{%- for lcode,flag in config.extra.flag -%}
{%- if lang != lcode -%}
{%- if lcode == config.default_language -%}
- <a type="Button" href="{{ current_url | replace(from=current_path | truncate(length=4, end=""), to="/") }}">{{ flag }}</a><br />
+ <a type="Button" href="{{ current_url | replace(from=current_path | truncate(length=4, end=""), to="/") }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ flag }}</a><br />
{%- else -%}
- <a type="Button" href="{{ current_url | replace(from=config.base_url, to=config.base_url ~ "/" ~ lcode) }}">{{ flag }}</a><br />
+ <a type="Button" href="{{ current_url | replace(from=config.base_url, to=config.base_url ~ "/" ~ lcode) }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ flag }}</a><br />
{%- endif -%}
{%- endif -%}
{%- endfor -%}