diff options
| author | Jieiku | 2023-05-22 23:07:56 -0700 |
|---|---|---|
| committer | Jieiku | 2023-05-22 23:07:56 -0700 |
| commit | d9fb3248650404ad6d078eba39b8b91381b1ebed (patch) | |
| tree | 74f539e18ab82b355c9a5fba542253aa46715579 /templates | |
| parent | 236919b4e6ce0c144ca4d5f12ab96a90de2042c2 (diff) | |
| download | abridge-d9fb3248650404ad6d078eba39b8b91381b1ebed.tar.gz abridge-d9fb3248650404ad6d078eba39b8b91381b1ebed.tar.bz2 abridge-d9fb3248650404ad6d078eba39b8b91381b1ebed.zip | |
Fixes for uglyurls
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/base.html | 12 | ||||
| -rw-r--r-- | templates/categories/list.html | 4 | ||||
| -rw-r--r-- | templates/categories/single.html | 2 | ||||
| -rw-r--r-- | templates/page.html | 4 | ||||
| -rw-r--r-- | templates/posts.html | 2 | ||||
| -rw-r--r-- | templates/tags/list.html | 4 | ||||
| -rw-r--r-- | templates/tags/single.html | 2 |
7 files changed, 15 insertions, 15 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 -%} diff --git a/templates/categories/list.html b/templates/categories/list.html index eca6da3..2e325c9 100644 --- a/templates/categories/list.html +++ b/templates/categories/list.html @@ -22,9 +22,9 @@ <p>{% for term in terms %} [<a href="#{{ term.name }}">{{ term.name }}</a>]<sup>{{ term.pages | length }}</sup> {% endfor %}</p> </div> {%- for term in terms %} - <h2 id="{{ term.name }}"><a href="{{ term.permalink | safe }}">{{ term.name }}</a></h2> + <h2 id="{{ term.name }}"><a href="{{ term.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ term.name }}</a></h2> {%- for page in term.pages %} - <p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p> + <p><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p> {%- endfor %} {%- endfor %} </div> diff --git a/templates/categories/single.html b/templates/categories/single.html index 1f5e48c..9e667b4 100644 --- a/templates/categories/single.html +++ b/templates/categories/single.html @@ -21,7 +21,7 @@ {%- for year, posts in term.pages | group_by(attribute="year") %} <h3>{{ year }}</h3> {%- for page in posts %} - <p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p> + <p><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p> {%- endfor %} {%- endfor %} </div> diff --git a/templates/page.html b/templates/page.html index 6d5188d..ba2b451 100644 --- a/templates/page.html +++ b/templates/page.html @@ -60,12 +60,12 @@ <h3>{%- if lang != config.default_language %}{{ trans(key="Index" | safe, lang=lang) }}{% else %}Index{% endif %}</h3> {%- for h in toc %} <div class="toc-item"> - <a class="subtext" href="{{h.permalink | safe}}">{{ h.title }}</a> + <a class="subtext" href="#{{h.id | safe}}">{{ h.title }}</a> </div> {%- if h.children %} {%- for h2 in h.children %} <div class="toc-item-child"> - <a class="subtext" href="{{h2.permalink | safe}}"><small>- {{ h2.title }}</small></a> + <a class="subtext" href="#{{h2.id | safe}}"><small>- {{ h2.title }}</small></a> </div> {%- endfor %} {%- endif %} diff --git a/templates/posts.html b/templates/posts.html index a353d15..92c07dc 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -27,7 +27,7 @@ {%- for year, posts in section_item.pages | group_by(attribute="year") %} <h2>{{ year }}</h2> {%- for post in posts %} - <p><a href="{{ post.permalink | safe }}">{{ post.title }}</a> - <time datetime="{{ post.date }}">{{ post.date | date(format="%F") }}</time></p> + <p><a href="{{ post.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ post.title }}</a> - <time datetime="{{ post.date }}">{{ post.date | date(format="%F") }}</time></p> {%- endfor %} {%- endfor %} </div> diff --git a/templates/tags/list.html b/templates/tags/list.html index c703761..a24ef09 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -22,9 +22,9 @@ <p>{% for term in terms %} #<a href="#{{ term.name }}">{{ term.name }}</a><sup>{{ term.pages | length }}</sup> {% endfor %}</p> </div> {%- for term in terms %} - <h2 id="{{ term.name }}">#<a href="{{ term.permalink | safe }}">{{ term.name }}</a></h2> + <h2 id="{{ term.name }}">#<a href="{{ term.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ term.name }}</a></h2> {%- for page in term.pages %} - <p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p> + <p><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p> {%- endfor %} {%- endfor %} </div> diff --git a/templates/tags/single.html b/templates/tags/single.html index ad8caeb..8984219 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -21,7 +21,7 @@ {%- for year, posts in term.pages | group_by(attribute="year") %} <h3>{{ year }}</h3> {%- for page in posts %} - <p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p> + <p><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p> {%- endfor %} {%- endfor %} </div> |
