diff options
| author | Jieiku | 2023-06-17 08:32:49 -0700 |
|---|---|---|
| committer | Jieiku | 2023-06-17 08:32:49 -0700 |
| commit | 0f00830b1d52c571cf725e0b522f09c43595462a (patch) | |
| tree | a466567f48b06272166f11cbcdfe0b449bb2e9db | |
| parent | 70d63c09257601596a0c4fab7cbc042bf03edb57 (diff) | |
| download | abridge-0f00830b1d52c571cf725e0b522f09c43595462a.tar.gz abridge-0f00830b1d52c571cf725e0b522f09c43595462a.tar.bz2 abridge-0f00830b1d52c571cf725e0b522f09c43595462a.zip | |
Whitespace Cleanup
| -rw-r--r-- | templates/base.html | 74 | ||||
| -rw-r--r-- | templates/macros/macros.html | 43 | ||||
| -rw-r--r-- | templates/page.html | 2 | ||||
| -rw-r--r-- | templates/pages.html | 3 | ||||
| -rw-r--r-- | templates/posts.html | 4 |
5 files changed, 63 insertions, 63 deletions
diff --git a/templates/base.html b/templates/base.html index 25994ae..e8706a6 100644 --- a/templates/base.html +++ b/templates/base.html @@ -52,37 +52,37 @@ {%- endif -%} </div> <div> - {%- set js_switcher=config.extra.js_switcher | default(value=true) -%} - {%- if config.extra.menu or js_switcher %} - {%- if config.extra.menu %} - {%- for i in config.extra.menu -%} - <a href="{{ get_url(path=i.url, lang=lang, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}> - {%- if lang != config.default_language %} {{ trans(key=i.name | safe, lang=lang) }} {% else %} {{ i.name | safe }} {% endif -%} - </a> - {%- endfor -%} - {%- endif -%} - {%- if js_switcher -%} - {%- set icon_adjust=config.extra.icon_adjust | default(value="svgs adjust") -%} - {%- if icon_adjust -%}<i type="reset" id="mode" class="js {{ icon_adjust }}"></i>{%- else -%}<i type="reset" id="mode" class="js mode">☀</i>{%- endif -%} + {% set js_switcher=config.extra.js_switcher | default(value=true) %} + {%- if config.extra.menu or js_switcher %} + {%- if config.extra.menu %} + {%- for i in config.extra.menu -%} + <a href="{{ get_url(path=i.url, lang=lang, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}> + {%- if lang != config.default_language %} {{ trans(key=i.name | safe, lang=lang) }} {% else %} {{ i.name | safe }} {% endif -%} + </a> + {%- endfor -%} + {%- endif -%} + {%- if js_switcher -%} + {%- set icon_adjust=config.extra.icon_adjust | default(value="svgs adjust") -%} + {%- if icon_adjust -%}<i type="reset" id="mode" class="js {{ icon_adjust }}"></i>{%- else -%}<i type="reset" id="mode" class="js mode">☀</i>{%- endif -%} + {%- endif -%} + {%- endif -%} + {%- if config.languages | length > 0 %} + <div class="dropdown" type="Button"> {%- if lang != config.default_language %}{{ trans(key="flag" | safe, lang=lang) }}{% else %}{{ config.extra.flag.en }}{% endif %} + {%- if current_url %} + <div class="dropdown-content"> + {%- 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="/") | safe }}{%- 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) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ flag }}</a><br /> {%- endif -%} {%- endif -%} - {%- if config.languages | length > 0 %} - <div class="dropdown" type="Button"> {%- if lang != config.default_language %}{{ trans(key="flag" | safe, lang=lang) }}{% else %}{{ config.extra.flag.en }}{% endif %} - {%- if current_url %} - <div class="dropdown-content"> - {%- 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="/") }}{%- 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) }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ flag }}</a><br /> - {%- endif -%} - {%- endif -%} - {%- endfor -%} - </div> - {%- endif %} + {%- endfor -%} </div> - {%- endif -%} + {%- endif %} + </div> + {%- endif %} </div> {%- if config.build_search_index %} {%- set icon_search=config.extra.icon_search | default(value="svgs search") %} @@ -127,21 +127,21 @@ {#- Copyright END #} {%- if config.extra.menu_footer %} <nav> - {%- for i in config.extra.menu_footer -%} - {%- if i.url != "sitemap.xml" %} - {%- set furl=get_url(path=i.url, lang=lang, trailing_slash=i.slash) %} - {%- else %} - {%- set furl=get_url(path=i.url, trailing_slash=i.slash) %} - {%- endif %} - <a{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %} href="{{ furl | safe }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}> {% if lang != config.default_language -%} {{ trans(key=i.name | safe, lang=lang) }} {%- else -%} {{ i.name | safe }} {% endif %} </a> - {%- endfor %} + {%- for i in config.extra.menu_footer -%} + {%- if i.url != "sitemap.xml" %} + {%- set furl=get_url(path=i.url, lang=lang, trailing_slash=i.slash) %} + {%- else %} + {%- set furl=get_url(path=i.url, trailing_slash=i.slash) %} + {%- endif %} + <a{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %} href="{{ furl | safe }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>{% if lang != config.default_language %} {{ trans(key=i.name | safe, lang=lang) }} {% else %} {{ i.name | safe }} {% endif %}</a> + {%- endfor %} </nav> {%- endif %} {%- if config.extra.footer_credit | default(value=true) %} {%- if config.extra.footer_credit_override %} {{ config.extra.footer_credit_override | safe }} {%- else %} - <p{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}>{%- if lang != config.default_language %} {{ trans(key="Powered_by" | safe, lang=lang) }} {% else %} Powered by {% endif %} <a href="https://www.getzola.org/" target="_blank">Zola</a> {%- if lang != config.default_language %} {{ trans(key="and" | safe, lang=lang) }} {% else %} and {% endif %} <a href="https://github.com/jieiku/abridge/" target="_blank">Abridge</a></p> + <p{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}>{% if lang != config.default_language -%} {{ trans(key="Powered_by" | safe, lang=lang) }} {% else -%} Powered by {% endif %}<a href="https://www.getzola.org/" target="_blank">Zola</a> {%- if lang != config.default_language %} {{ trans(key="and" | safe, lang=lang) }} {% else %} and {% endif -%} <a href="https://github.com/jieiku/abridge/" target="_blank">Abridge</a></p> {%- endif %} {%- endif %} </div> diff --git a/templates/macros/macros.html b/templates/macros/macros.html index bc38935..4c86aac 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,9 +1,9 @@ {%- macro title_post(page, config) %} - <h1><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a></h1> + <h1><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a></h1> {%- endmacro title_post %} {%- macro meta_post(page, config) %} - <span{%- if config.extra.meta_post.size %} class="{{ config.extra.meta_post.size }}"{% endif %}> + <span{%- if config.extra.meta_post.size %} class="{{ config.extra.meta_post.size }}"{% endif %}> {#- Author #} {%- if page.taxonomies.authors and config.taxonomies %} @@ -119,25 +119,26 @@ {%- macro footer(page, config) %} -{%- if page.reading_time and page.reading_time > 2 %} -<p><b><a href="#">Back to top</a></b></p> -{%- endif %} -<nav><!-- prev/next page title. Keep for CSS selector even if empty --> -{% if not config.extra.hide_page_nextprev_titles | default(value=false) %} -{% if page.lower or page.higher-%} - <div> - {% if page.lower -%} - <a href="{{ page.lower.permalink | safe }}">‹ {{ page.lower.title | truncate(length=100) }}</a> - {%- endif %} - </div> - <div> - {% if page.higher -%} - <a href="{{ page.higher.permalink | safe }}"> {{ page.higher.title | truncate(length=100) }} ›</a> - {%- endif %} - </div> -{%- endif %} -{%- endif %} -</nav> + {%- if page.reading_time and page.reading_time > 2 %} + <p><b><a href="#">Back to top</a></b></p> + {%- endif %} + {#- prev/next content page nextprev title pagination #} + {%- if not config.extra.hide_page_nextprev_titles | default(value=false) %} + {%- if page.lower or page.higher %} + <nav> + <div> + {%- if page.lower %} + <a href="{{ page.lower.permalink | safe }}">‹ {{ page.lower.title | truncate(length=100) }}</a> + {%- endif %} + </div> + <div> + {%- if page.higher %} + <a href="{{ page.higher.permalink | safe }}"> {{ page.higher.title | truncate(length=100) }} ›</a> + {%- endif %} + </div> + </nav> + {%- endif %} + {%- endif %} {%- endmacro footer %} diff --git a/templates/page.html b/templates/page.html index 979e0a1..7b645ca 100644 --- a/templates/page.html +++ b/templates/page.html @@ -39,7 +39,7 @@ {{- macros::meta_post(page=page, config=config) }} {%- endif %}{%- endif %} - {{ page.content | safe }} +{{ page.content | safe }} {%- if config.extra.meta_post.position %} {%- if config.extra.meta_post.position == "bottom" or config.extra.meta_post.position == "both" %} diff --git a/templates/pages.html b/templates/pages.html index 87c9adb..4ef44f5 100644 --- a/templates/pages.html +++ b/templates/pages.html @@ -26,6 +26,7 @@ {%- block content %} <div> - {{ page.content | safe }} + +{{ page.content | safe }} </div> {%- endblock content %} diff --git a/templates/posts.html b/templates/posts.html index b4e123e..f9befe5 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -51,9 +51,7 @@ This Template can also be used as the rendering template for Sections, eg: examp {%- if section_item.title %} <h2>{{ section_item.title }}</h2> {%- endif %} - - {{ section_item.content | safe }} - + {{- section_item.content | safe }} {%- for year, posts in section_item.pages | group_by(attribute="year") %} {%- if not hide_section_dates %} {%- if section_item.title %} |
