diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/404.html | 6 | ||||
| -rw-r--r-- | templates/base.html | 56 | ||||
| -rw-r--r-- | templates/categories/list.html | 2 | ||||
| -rw-r--r-- | templates/contact.fr.html | 49 | ||||
| -rw-r--r-- | templates/index.html | 6 | ||||
| -rw-r--r-- | templates/macros/head.html | 17 | ||||
| -rw-r--r-- | templates/macros/macros.html | 30 | ||||
| -rw-r--r-- | templates/macros/social.html | 97 | ||||
| -rw-r--r-- | templates/page.html | 2 | ||||
| -rw-r--r-- | templates/posts.html | 6 | ||||
| -rw-r--r-- | templates/tags/list.html | 2 |
11 files changed, 189 insertions, 84 deletions
diff --git a/templates/404.html b/templates/404.html index 02c7688..f26dafb 100644 --- a/templates/404.html +++ b/templates/404.html @@ -17,8 +17,8 @@ {%- block content %} <div> - <h1>Page not found :(</h1> - <p>The page you are looking for doesn't exist or has been moved.</p> - <p>Try using the search, or <a href="{{ config.base_url | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">go home</a>.</p> + <h1>404 :(</h1> + <p>The page you are looking for doesn't exist or has been moved. Try using the search, or <a href="{{ config.base_url | safe }}/{%- if config.extra.uglyurls %}index.html{%- endif %}">go home</a>.</p> + <p>La page que vous recherchez n'existe pas ou a été déplacée. Essayez d'utiliser la recherche, ou <a href="{{ config.base_url | safe }}/fr/{%- if config.extra.uglyurls %}index.html{%- endif %}">rentrez chez vous</a>.</p> </div> {%- endblock content %} diff --git a/templates/base.html b/templates/base.html index a1e4918..6a6927a 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="{{ config.extra.language_code | default(value='en-US') }}"> +<html lang="{{ lang }}"> <head> {{- macros_head::theme(config=config) }} {{- macros_head::stylesheets(config=config) }} @@ -37,16 +37,16 @@ <nav> <div> {%- if config.extra.logo -%} - <h1><a href="{{ config.base_url | safe }}/{%- 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="{{ config.base_url | safe }}/{%- 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="{{ config.base_url | safe }}/{%- 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> @@ -55,8 +55,35 @@ {%- if config.extra.menu or js_switcher %} {%- if config.extra.menu %} {%- for i in config.extra.menu -%} - <li> <h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>{{ i.name | safe }}</a></h2> </li> + <li> <h2><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></h2> </li> + {%- endfor -%} + {%- endif -%} + {%- set language_count = 1 -%} + {%- for language_name, language in config.languages -%} + {%- set_global language_count = language_count + 1 -%} {%- endfor -%} + {%- if language_count > 1 %} + <li class="js"><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="/") }}">{{ flag }}</a><br /> + {%- else -%} + <a type="Button" href="{{ current_url | replace(from=config.base_url, to=config.base_url ~ "/" ~ lcode) }}">{{ flag }}</a><br /> + {%- endif -%} + {%- endif -%} + {%- endfor -%} + </div> + {%- endif %} + </div></li> {%- endif -%} {%- if js_switcher -%} {%- set icon_adjust=config.extra.icon_adjust | default(value="svgs adjust") -%} @@ -66,11 +93,11 @@ </ul> </div> {%- if config.build_search_index %} - {%- set icon_search=config.extra.icon_search | default(value="svgs search") -%} + {%- set icon_search=config.extra.icon_search | default(value="svgs search") %} <div> <form autocomplete=off class="js" name="goSearch" id="searchbox"> <div class="searchd"> - <input id="searchinput" type="text" placeholder="Search" title="Search"{% if config.extra.search_library %}{% if config.extra.search_library == "stork" %} data-stork="stork" {% endif %}{% endif %} /> + <input id="searchinput" type="text" placeholder="{%- if lang != config.default_language %}{{ trans(key="Search" | safe, lang=lang) }}{% else %}Search{% endif %}" title="Search"{% if config.extra.search_library %}{% if config.extra.search_library == "stork" %} data-stork="stork" {% endif %}{% endif %} /> <button type="submit" title="Search">{%- if icon_search -%}<i class="{{ icon_search }}"></i>{%- else -%}<span class="si">⌕</span>{%- endif -%}</button> </div> <div><div id="suggestions"{% if config.extra.search_library %}{% if config.extra.search_library == "stork" %} data-stork="stork-output" {% endif %}{% endif %}></div></div> @@ -98,21 +125,24 @@ <hr /> {%- endif %} <div class="c"> - {%- if config.extra.social %} - {{- social_macros::social_links(social_config=config.extra.social, config=config) }} - {%- endif %} + {{- social_macros::social_links(config=config) }} {#- Copyright START #} {%- set copyright_start_year=config.extra.copyright_start_year | default(value="") %} {%- if copyright_start_year %}{%- set copyright_start_year=copyright_start_year ~ "-" %}{%- endif %} {%- set copyright_end_year=config.extra.copyright_end_year | default(value=now() | date(format="%Y")) %} - <p{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}>Copyright © {{ copyright_start_year ~ copyright_end_year }} {{ config.title }}</p> + <p{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}> © {{ copyright_start_year ~ copyright_end_year }} {{ config.title }}</p> {#- Copyright END #} {%- if config.extra.menu_footer %} <nav> <ul> {%- for i in config.extra.menu_footer -%} - <li{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}> <a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}> {{ i.name | safe }} </a> </li> + {%- 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 %} + <li{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}> <a href="{{ furl }}{%- 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> </li> {%- endfor -%} </ul> </nav> @@ -121,7 +151,7 @@ {%- 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 %}>Powered by <a href="https://www.getzola.org/" target="_blank">Zola</a> and <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/categories/list.html b/templates/categories/list.html index 1ded228..a237591 100644 --- a/templates/categories/list.html +++ b/templates/categories/list.html @@ -18,7 +18,7 @@ {%- block content %} <div> <div class="c"> - <h1>{{ terms | length }} Categories</h1> + <h1>{{ terms | length }} {%- if lang != config.default_language %} {{ trans(key="Categories" | safe, lang=lang) }} {% else %} Categories {% endif %}</h1> <p>{% for term in terms %} [<a href="#{{ term.name }}">{{ term.name }}</a>] {% endfor %}</p> </div> {%- for term in terms %} diff --git a/templates/contact.fr.html b/templates/contact.fr.html new file mode 100644 index 0000000..d23569d --- /dev/null +++ b/templates/contact.fr.html @@ -0,0 +1,49 @@ +{# Cette page affiche la page de contact, par exemple: example.com/contact/ #} + +{% extends "base.html" %} + +{%- block seo %} + {{- super() }} + {%- set title_addition = "" %} + + {%- if page.title and config.title %} + {%- set title = page.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- elif page.title %} + {%- set title = page.title %} + {%- else %} + {%- set title = config.title %} + {%- endif %} + + {%- if page.description %} + {%- set description = page.description %} + {%- else %} + {%- set description = config.description %} + {%- endif %} + + {{- macros_head::seo(config=config, title=title, title_addition=title_addition, description=description) }} +{%- endblock seo %} + +{%- block content %} + <div> + <p>Vous voulez entrer en contact ? Remplissez le formulaire ci-dessous pour m'envoyer un message et je vous répondrai dans les plus brefs délais !</p> + <form name="contact" method="POST"> + <p> + <label for="name">Nom</label> + <input type="text" placeholder="Nom" id="name" required data-validation-required-message="S'il vous plaît entrez votre nom." /> + </p> + <p> + <label for="email">Adresse e-mail</label> + <input type="email" placeholder="nom@example.com" id="email" required data-validation-required-message="Veuillez saisir votre adresse e-mail." /> + </p> + <p> + <label for="message">Message</label> + <textarea rows="5" placeholder="Message" id="message" required data-validation-required-message="Veuillez entrer un message."></textarea> + </p> + <div id="success"></div> + <p> + <button type="submit" id="sendMessageButton">Envoyer</button> + </p> + </form> + </div> +{%- endblock content %} diff --git a/templates/index.html b/templates/index.html index 4702e16..84314b1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -54,11 +54,15 @@ {%- endfor %} {{- macros::pagination(paginator=paginator, config=config) }} </div> + {%- if lang == config.default_language %} {%- set section_item = get_section(path="_index.md") %} + {%- else %} + {%- set section_item = get_section(path="_index." ~ lang ~ ".md") %} + {%- endif %} {%- if config.extra.recent | default(value=true) %} <div class="toc"> <div class="toc-sticky"> - <h1><span class="s75">Recent Posts</span></h1> + <h1><span class="s70">{%- if lang != config.default_language %}{{ trans(key="Recent_Posts" | safe, lang=lang) }}{% else %}Recent Posts{% endif %}</span></h1> {%- set recent_items=config.extra.recent_items | default(value=9) -%} {%- for page in section_item.pages | slice(end=recent_items) %} {{- page_macros::page_listing(page=page, config=config) }} diff --git a/templates/macros/head.html b/templates/macros/head.html index 8da09cb..0690bc1 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -103,7 +103,7 @@ {%- set js_email=config.extra.js_email | default(value="email.js") -%} {%- if js_email %} - {%- if config.extra.social.mail_encode | default(value=true) %} + {%- if config.extra.mail_encode | default(value=true) %} <script defer src="{{ get_url(path=js_email, trzailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path=js_email, sha_type=384, base64=true) | safe }}"{%- endif %}></script> {%- endif %} {%- endif %} @@ -120,12 +120,15 @@ {%- else %} <script defer src="{{ get_url(path='elasticlunr.min.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='elasticlunr.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> <script defer src="{{ get_url(path='search.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='search.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> - {%- endif %} - -{%- endif %} + {%- if lang != "en" %} + <script defer src="{{ get_url(path='lunr.stemmer.support.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='lunr.stemmer.support.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> + <script defer src="{{ get_url(path='lunr.' ~ lang ~ '.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity | default(value=true) %} integrity="sha384-{{ get_hash(path='lunr.' ~ lang ~ '.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script> + {%- endif %} + {%- endif %} +{%- endif %} {#- https://katex.org/docs/autorender.html #} @@ -344,9 +347,9 @@ <meta property="og:updated_time" content="{{ updated_time }}" /> {%- endif %} -{%- if config.extra.social.twitter %} - <meta name="twitter:site" content="@{{ config.extra.twitter }}" /> - <meta name="twitter:creator" content="@{{ config.extra.twitter }}" /> +{%- if config.extra.twitter_meta %} + <meta name="twitter:site" content="@{{ config.extra.twitter_meta }}" /> + <meta name="twitter:creator" content="@{{ config.extra.twitter_meta }}" /> {%- endif %} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 95c922c..e909b06 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -36,16 +36,24 @@ {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} {%- endif %}{%- endif %}{%- endif %} {#- Date #} - {%- if config.extra.meta_post.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %} {{ page.date | date(format="%B %d, %Y") }} + {%- if config.extra.meta_post.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %} + {%- if config.extra.date_locale %} + {%- if lang != config.default_language -%} + {%- set lang_locale = trans(key="date_locale" | safe, lang=lang) -%} + {%- else -%} + {%- set lang_locale = config.extra.date_locale -%} + {%- endif -%} + {{ page.date | date(format="%B %d, %Y", locale=lang_locale) }} + {%- else %} {{ page.date | date(format="%B %d, %Y") }} {%- endif %} {#- divider #} {%- if config.extra.meta_post.categories_tags %} {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} {%- endif %}{%- endif %}{% endif %} {#- Categories #} - {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i> {% endif %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ cat }}</a>{% endfor %}]{% endif %} + {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i> {% endif %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat, lang=lang) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ cat }}</a>{% endfor %}]{% endif %} {#- Tags #} - {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span> + {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag, lang=lang) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span> {%- endmacro meta_post %} {%- macro title_index(page, config) %} @@ -60,7 +68,7 @@ {%- if page.taxonomies.authors and config.taxonomies %} {%- for author in page.taxonomies.authors %} {%- if author_flag %}, {% endif %} - <a href="{{ get_taxonomy_url(kind='authors', name=author) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ author }}</a> + <a href="{{ get_taxonomy_url(kind='authors', name=author, lang=lang) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ author }}</a> {%- set_global author_flag = true %} {%- endfor %} {%- elif page.extra.authors and config.extra.meta_index.author %} @@ -87,16 +95,24 @@ {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} {%- endif %}{%- endif %}{%- endif %} {#- Date #} - {%- if config.extra.meta_index.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %} {{ page.date | date(format="%B %d, %Y") }} + {%- if config.extra.meta_index.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %} + {%- if config.extra.date_locale %} + {%- if lang != config.default_language -%} + {%- set lang_locale = trans(key="date_locale" | safe, lang=lang) -%} + {%- else -%} + {%- set lang_locale = config.extra.date_locale -%} + {%- endif -%} + {{ page.date | date(format="%B %d, %Y", locale=lang_locale) }} + {%- else %} {{ page.date | date(format="%B %d, %Y") }} {%- endif %} {#- divider #} {%- if config.extra.meta_index.categories_tags %} {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} {%- endif %}{%- endif %}{% endif %} {#- Categories #} - {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i> {% endif %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ cat }}</a>{% endfor %}]{% endif %} + {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i> {% endif %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat, lang=lang) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ cat }}</a>{% endfor %}]{% endif %} {#- Tags #} - {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span> + {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag, lang=lang) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span> {%- endmacro meta_index %} diff --git a/templates/macros/social.html b/templates/macros/social.html index 67e05a3..1c4b3fd 100644 --- a/templates/macros/social.html +++ b/templates/macros/social.html @@ -1,59 +1,58 @@ -{%- macro social_links(social_config, config) %} +{%- macro social_links(config) %} <nav> <ul> -{%- set base_url = get_url(path="", lang=lang) -%} - {%- if config.generate_feed -%}{%- if config.extra.social.feed -%} + {%- if config.generate_feed -%}{%- if config.extra.feed -%} <li><a href="{{ get_url(path=config.feed_filename, trailing_slash=false) | safe }}" target="_blank" title="Atom/RSS Feed"><i type="Button" class="svg rss" title="Atom/RSS Feed"></i></a></li>{% endif -%}{% endif -%} - {%- if social_config.mail -%} - {%- if social_config.mail_encode | default(value=true) -%} - {%- set base64_email = social_config.mail -%} + {%- if config.extra.mail -%} + {%- if config.extra.mail_encode | default(value=true) -%} + {%- set base64_email = config.extra.mail -%} <li class="js"><a class="m-protected" href="#{{ base64_email | base64_encode }}" target="_blank" title="Mail"><i type="Button" class="svg mail" title="Mail"></i></a></li> {%- else -%} - <li><a href="mailto:{{ social_config.mail }}" target="_blank" title="Mail"><i type="Button" class="svg mail" title="Mail"></i></a></li> + <li><a href="mailto:{{ config.extra.mail }}" target="_blank" title="Mail"><i type="Button" class="svg mail" title="Mail"></i></a></li> {%- endif -%} {% endif -%} - {%- if social_config.mastodon -%} - <li><a href="{{ social_config.mastodon | safe }}" target="_blank" title="Mastodon" rel="me"><i type="Button" class="svg mastodon" title="Mastodon"></i></a></li>{% endif -%} - {%- if social_config.element -%} - <li><a href="https://{{ social_config.element }}/" target="_blank" title="Element"><i type="Button" class="svg element" title="Element"></i></a></li>{% endif -%} - {%- if social_config.matrix -%} - <li><a href="https://{{ social_config.matrix }}/" target="_blank" title="Matrix"><i type="Button" class="svg matrix" title="Matrix"></i></a></li>{% endif -%} - {%- if social_config.twitter -%} - <li><a href="https://twitter.com/{{ social_config.twitter }}/" target="_blank" title="Twitter"><i type="Button" class="svg twitter" title="Twitter"></i></a></li>{% endif -%} - {%- if social_config.facebook -%} - <li><a href="https://www.facebook.com/{{ social_config.facebook }}/" target="_blank" title="Facebook"><i type="Button" class="svg facebook" title="Facebook"></i></a></li>{% endif -%} - {%- if social_config.linkedin -%} - <li><a href="https://www.linkedin.com/in/{{ social_config.linkedin }}/" target="_blank" title="LinkedIn"><i type="Button" class="svg linkedin" title="LinkedIn"></i></a></li>{% endif -%} - {%- if social_config.researchgate -%} - <li><a href="https://www.researchgate.net/profile/{{ social_config.researchgate }}/" target="_blank" title="ResearchGate"><i type="Button" class="svg researchgate" title="ResearchGate"></i></a></li>{% endif -%} - {%- if social_config.codeberg -%} - <li><a href="https://codeberg.org/{{ social_config.codeberg }}/" target="_blank" title="Codeberg"><i type="Button" class="svg codeberg" title="Codeberg"></i></a></li>{% endif -%} - {%- if social_config.gitlab -%} - <li><a href="https://gitlab.com/{{ social_config.gitlab }}/" target="_blank" title="Gitlab"><i type="Button" class="svg gitlab" title="Gitlab"></i></a></li>{% endif -%} - {%- if social_config.github -%} - <li><a href="https://github.com/{{ social_config.github }}/" target="_blank" title="Github"><i type="Button" class="svg github" title="Github"></i></a></li>{% endif -%} - {%- if social_config.bitbucket -%} - <li><a href="https://bitbucket.org/{{ social_config.bitbucket }}/" target="_blank" title="Bitbucket"><i type="Button" class="svg bitbucket" title="Bitbucket"></i></a></li>{% endif -%} - {%- if social_config.python -%} - <li><a href="https://pypi.org/user/{{ social_config.python }}/" target="_blank" title="Python"><i type="Button" class="svg python" title="Python"></i></a></li>{% endif -%} - {%- if social_config.docker -%} - <li><a href="https://hub.docker.com/u/{{ social_config.docker }}/" target="_blank" title="Docker"><i type="Button" class="svg docker" title="Docker"></i></a></li>{% endif -%} - {%- if social_config.stack -%} - <li><a href="https://stackoverflow.com/users/{{ social_config.stack }}/" target="_blank" title="Stack"><i type="Button" class="svg stack" title="Stack"></i></a></li>{% endif -%} - {%- if social_config.instagram -%} - <li><a href="https://www.instagram.com/{{ social_config.instagram }}/" target="_blank" title="Instagram"><i type="Button" class="svg instagram" title="Instagram"></i></a></li>{% endif -%} - {%- if social_config.pinterest -%} - <li><a href="https://www.pinterest.com/{{ social_config.pinterest }}/" target="_blank" title="Pinterest"><i type="Button" class="svg pinterest" title="Pinterest"></i></a></li>{% endif -%} - {%- if social_config.twitch -%} - <li><a href="https://www.twitch.tv/{{ social_config.twitch }}/" target="_blank" title="Twitch"><i type="Button" class="svg twitch" title="Twitch"></i></a></li>{% endif -%} - {%- if social_config.discord -%} - <li><a href="https://discord.com/{{ social_config.discord }}/" target="_blank" title="Discord"><i type="Button" class="svg discord" title="Discord"></i></a></li>{% endif -%} - {%- if social_config.youtube -%} - <li><a href="https://www.youtube.com/{{ social_config.youtube }}" target="_blank" title="YouTube"><i type="Button" class="svg youtube" title="YouTube"></i></a></li>{% endif -%} - {%- if social_config.buymeacoffee -%} - <li><a href="https://www.buymeacoffee.com/{{ social_config.buymeacoffee }}/" target="_blank" title="Buy Me A Coffee"><i type="Button" class="svg buymeacoffee" title="Buy Me A Coffee"></i></a></li>{% endif -%} - {%- if social_config.github_sponsor -%} - <li><a href="https://github.com/sponsors/{{ social_config.github_sponsor }}/" target="_blank" title="GitHub Sponsor"><i type="Button" class="svg github-sponsor" title="GitHub Sponsor"></i></a></li>{% endif -%} + {%- if config.extra.mastodon -%} + <li><a href="{{ config.extra.mastodon | safe }}" target="_blank" title="Mastodon" rel="me"><i type="Button" class="svg mastodon" title="Mastodon"></i></a></li>{% endif -%} + {%- if config.extra.element -%} + <li><a href="https://{{ config.extra.element }}/" target="_blank" title="Element"><i type="Button" class="svg element" title="Element"></i></a></li>{% endif -%} + {%- if config.extra.matrix -%} + <li><a href="https://{{ config.extra.matrix }}/" target="_blank" title="Matrix"><i type="Button" class="svg matrix" title="Matrix"></i></a></li>{% endif -%} + {%- if config.extra.twitter -%} + <li><a href="https://twitter.com/{{ config.extra.twitter }}/" target="_blank" title="Twitter"><i type="Button" class="svg twitter" title="Twitter"></i></a></li>{% endif -%} + {%- if config.extra.facebook -%} + <li><a href="https://www.facebook.com/{{ config.extra.facebook }}/" target="_blank" title="Facebook"><i type="Button" class="svg facebook" title="Facebook"></i></a></li>{% endif -%} + {%- if config.extra.linkedin -%} + <li><a href="https://www.linkedin.com/in/{{ config.extra.linkedin }}/" target="_blank" title="LinkedIn"><i type="Button" class="svg linkedin" title="LinkedIn"></i></a></li>{% endif -%} + {%- if config.extra.researchgate -%} + <li><a href="https://www.researchgate.net/profile/{{ config.extra.researchgate }}/" target="_blank" title="ResearchGate"><i type="Button" class="svg researchgate" title="ResearchGate"></i></a></li>{% endif -%} + {%- if config.extra.codeberg -%} + <li><a href="https://codeberg.org/{{ config.extra.codeberg }}/" target="_blank" title="Codeberg"><i type="Button" class="svg codeberg" title="Codeberg"></i></a></li>{% endif -%} + {%- if config.extra.gitlab -%} + <li><a href="https://gitlab.com/{{ config.extra.gitlab }}/" target="_blank" title="Gitlab"><i type="Button" class="svg gitlab" title="Gitlab"></i></a></li>{% endif -%} + {%- if config.extra.github -%} + <li><a href="https://github.com/{{ config.extra.github }}/" target="_blank" title="Github"><i type="Button" class="svg github" title="Github"></i></a></li>{% endif -%} + {%- if config.extra.bitbucket -%} + <li><a href="https://bitbucket.org/{{ config.extra.bitbucket }}/" target="_blank" title="Bitbucket"><i type="Button" class="svg bitbucket" title="Bitbucket"></i></a></li>{% endif -%} + {%- if config.extra.python -%} + <li><a href="https://pypi.org/user/{{ config.extra.python }}/" target="_blank" title="Python"><i type="Button" class="svg python" title="Python"></i></a></li>{% endif -%} + {%- if config.extra.docker -%} + <li><a href="https://hub.docker.com/u/{{ config.extra.docker }}/" target="_blank" title="Docker"><i type="Button" class="svg docker" title="Docker"></i></a></li>{% endif -%} + {%- if config.extra.stack -%} + <li><a href="https://stackoverflow.com/users/{{ config.extra.stack }}/" target="_blank" title="Stack"><i type="Button" class="svg stack" title="Stack"></i></a></li>{% endif -%} + {%- if config.extra.instagram -%} + <li><a href="https://www.instagram.com/{{ config.extra.instagram }}/" target="_blank" title="Instagram"><i type="Button" class="svg instagram" title="Instagram"></i></a></li>{% endif -%} + {%- if config.extra.pinterest -%} + <li><a href="https://www.pinterest.com/{{ config.extra.pinterest }}/" target="_blank" title="Pinterest"><i type="Button" class="svg pinterest" title="Pinterest"></i></a></li>{% endif -%} + {%- if config.extra.twitch -%} + <li><a href="https://www.twitch.tv/{{ config.extra.twitch }}/" target="_blank" title="Twitch"><i type="Button" class="svg twitch" title="Twitch"></i></a></li>{% endif -%} + {%- if config.extra.discord -%} + <li><a href="https://discord.com/{{ config.extra.discord }}/" target="_blank" title="Discord"><i type="Button" class="svg discord" title="Discord"></i></a></li>{% endif -%} + {%- if config.extra.youtube -%} + <li><a href="https://www.youtube.com/{{ config.extra.youtube }}" target="_blank" title="YouTube"><i type="Button" class="svg youtube" title="YouTube"></i></a></li>{% endif -%} + {%- if config.extra.buymeacoffee -%} + <li><a href="https://www.buymeacoffee.com/{{ config.extra.buymeacoffee }}/" target="_blank" title="Buy Me A Coffee"><i type="Button" class="svg buymeacoffee" title="Buy Me A Coffee"></i></a></li>{% endif -%} + {%- if config.extra.github_sponsor -%} + <li><a href="https://github.com/sponsors/{{ config.extra.github_sponsor }}/" target="_blank" title="GitHub Sponsor"><i type="Button" class="svg github-sponsor" title="GitHub Sponsor"></i></a></li>{% endif -%} </ul> </nav> {%- endmacro %} diff --git a/templates/page.html b/templates/page.html index da4fdd6..6d5188d 100644 --- a/templates/page.html +++ b/templates/page.html @@ -57,7 +57,7 @@ {%- if toc %} <div class="toc" aria-hidden="true"> <div class="toc-sticky"> - <h3>Index</h3> + <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> diff --git a/templates/posts.html b/templates/posts.html index d4fc9e4..a353d15 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -18,7 +18,11 @@ {%- endblock seo %} {%- block content %} -{%- set section_item = get_section(path="_index.md") %} + {%- if lang == config.default_language %} + {%- set section_item = get_section(path="_index.md") %} + {%- else %} + {%- set section_item = get_section(path="_index." ~ lang ~ ".md") %} + {%- endif %} <div> {%- for year, posts in section_item.pages | group_by(attribute="year") %} <h2>{{ year }}</h2> diff --git a/templates/tags/list.html b/templates/tags/list.html index 545bf34..2184cba 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -18,7 +18,7 @@ {%- block content %} <div> <div class="c"> - <h1>{{ terms | length }} Tags</h1> + <h1>{{ terms | length }} {%- if lang != config.default_language %} {{ trans(key="Tags" | safe, lang=lang) }} {% else %} Tags {% endif %}</h1> <p>{% for term in terms %} #<a href="#{{ term.name }}">{{ term.name }}</a> {% endfor %}</p> </div> {%- for term in terms %} |
