mirror of
https://github.com/welpo/tabi.git
synced 2025-12-14 11:48:45 +01:00
fix(serie): fix typo on series
This commit is contained in:
parent
152adf5645
commit
266e742a6c
12 changed files with 94 additions and 93 deletions
|
|
@ -1,15 +1,15 @@
|
|||
+++
|
||||
title = "How to deal with series"
|
||||
template = "serie.html"
|
||||
template = "series.html"
|
||||
sort_by = "date"
|
||||
|
||||
description = "This serie is about demoing how does serie works."
|
||||
description = "This serie is about demoing how does series works."
|
||||
|
||||
transparent = true
|
||||
|
||||
[extra]
|
||||
serie = true
|
||||
serie_page_description = "full"
|
||||
series = true
|
||||
series_page_description = "full"
|
||||
+++
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "First article of the serie"
|
||||
title = "First article of the series"
|
||||
date = 2023-08-01
|
||||
description = "This is the first article of the serie."
|
||||
description = "This is the first article of the series."
|
||||
|
||||
[taxonomies]
|
||||
tags = ["showcase", "tutorial", "FAQ"]
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
+++
|
||||
title = "Second article of the serie"
|
||||
title = "Second article of the series"
|
||||
date = 2023-09-15
|
||||
description = "This is the second article of the serie."
|
||||
description = "This is the second article of the series."
|
||||
|
||||
[taxonomies]
|
||||
tags = ["showcase", "tutorial", "FAQ"]
|
||||
|
||||
[extra]
|
||||
serie_page_description = "none"
|
||||
series_page_description = "none"
|
||||
+++
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "Third article of the serie"
|
||||
title = "Third article of the series"
|
||||
date = 2024-07-28
|
||||
description = "This is the third article of the serie."
|
||||
description = "This is the third article of the series."
|
||||
|
||||
[taxonomies]
|
||||
tags = ["showcase", "tutorial", "FAQ"]
|
||||
10
i18n/en.toml
10
i18n/en.toml
|
|
@ -62,11 +62,11 @@ see_changes = "See changes"
|
|||
table_of_contents = "Table of Contents"
|
||||
load_comments = "Load comments"
|
||||
|
||||
# Serie.
|
||||
serie = "SERIE"
|
||||
serie_go_to_posts = "Go to serie's posts"
|
||||
serie_posts = "Serie's posts:"
|
||||
page_of_a_serie = "This article is part of the serie: "
|
||||
# Series.
|
||||
series = "SERIES"
|
||||
series_go_to_posts = "Go to series' posts"
|
||||
series_posts = "Series' posts:"
|
||||
page_of_a_series = "This article is part of the series: "
|
||||
|
||||
# Copy code block button.
|
||||
copied = "Copied!"
|
||||
|
|
|
|||
10
i18n/fr.toml
10
i18n/fr.toml
|
|
@ -62,11 +62,11 @@ see_changes = "Voir les modifications"
|
|||
table_of_contents = "Table des matières"
|
||||
load_comments = "Afficher les commentaires"
|
||||
|
||||
# Serie.
|
||||
serie = "SERIE"
|
||||
serie_go_to_posts = "Aller aux articles de la série"
|
||||
serie_posts = "Articles de la série :"
|
||||
page_of_a_serie = "Cet article fait partie de la série : "
|
||||
# Series.
|
||||
series = "SERIE"
|
||||
series_go_to_posts = "Aller aux articles de la série"
|
||||
series_posts = "Articles de la série :"
|
||||
page_of_a_series = "Cet article fait partie de la série : "
|
||||
|
||||
# Copy code block button.
|
||||
copied = "Copié !"
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ details summary {
|
|||
transform: rotate(270deg);
|
||||
}
|
||||
|
||||
.page-serie {
|
||||
.series-page {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,28 +68,28 @@
|
|||
}
|
||||
}
|
||||
|
||||
#serie-title {
|
||||
#series-title {
|
||||
#go-to-button {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.serielist-title {
|
||||
.serieslist-title {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.serielist-container {
|
||||
.serieslist-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 8fr;
|
||||
}
|
||||
|
||||
.serielist-row {
|
||||
.serieslist-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
background-color: var(--navbar-color);
|
||||
padding: 1rem 0;
|
||||
|
||||
.serielist-meta {
|
||||
.serieslist-meta {
|
||||
margin-right: 0.7rem;
|
||||
padding: 0;
|
||||
color: var(--meta-color);
|
||||
|
|
@ -106,10 +106,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
.serielist-content {
|
||||
.serieslist-content {
|
||||
flex: 1;
|
||||
|
||||
.serielist-title {
|
||||
.serieslist-title {
|
||||
margin: 0;
|
||||
font-weight: bold;
|
||||
font-size: 1.2em;
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
|
||||
{% include "partials/page_serie.html" %}
|
||||
{% include "partials/series_page.html" %}
|
||||
|
||||
{% if page.extra.tldr %}
|
||||
<div class="tldr">
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
{# We have to retrieve the first section having the `extra.serie` parameter set to true #}
|
||||
{# As a serie might be a transparent section in order to mix up its article with the one of the section just above or the root, #}
|
||||
{# there is no other way but to compute the potential path of each section related to the page and look for the first one being a serie #}
|
||||
{%- set current_path = [] -%}
|
||||
{%- set section_paths = [] -%}
|
||||
{%- for path in page.relative_path | split(pat="/") | slice(end=-1) -%}
|
||||
{%- set_global current_path = current_path | concat(with=path) -%}
|
||||
{%- set section_path = current_path | concat(with="_index.md") | join(sep="/") -%}
|
||||
{%- set_global section_paths = section_paths | concat(with=section_path) -%}
|
||||
{%- endfor -%}
|
||||
{# We identify the closest serie of the page, if any #}
|
||||
{%- for section_path in section_paths | reverse -%}
|
||||
{%- set section_file_exists = load_data(path=section_path, required=false) -%}
|
||||
{%- if section_file_exists -%}
|
||||
{%- set section = get_section(path=section_path,lang=lang) -%}
|
||||
{%- if "serie" in section.extra and section.extra.serie -%}
|
||||
{%- set_global serie_section = section -%}
|
||||
{%- break -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if serie_section -%}
|
||||
{%- set page_of_a_serie = macros_translate::translate(key="page_of_a_serie", default="This article is part of the serie: ", language_strings=language_strings) -%}
|
||||
{%- if macros_settings::evaluate_setting_priority(setting="serie_page_description", page=page, section=serie_section, default_global_value="none") == "full" -%}
|
||||
<details class="page-serie">
|
||||
<summary>
|
||||
{{ page_of_a_serie }}<a href="{{ serie_section.permalink | safe }}" aria_label="{{ serie_section.title | safe }}">{{ serie_section.title }}</a>
|
||||
</summary>
|
||||
{{ serie_section.description | safe }}
|
||||
{%- set ordered_serie_pages = serie_section.pages | reverse -%}
|
||||
<nav>
|
||||
<ol>
|
||||
{%- for serie_page in ordered_serie_pages -%}
|
||||
{%- if serie_page.relative_path == page.relative_path -%}
|
||||
<li>{{ serie_page.title }}</li>
|
||||
{%- else -%}
|
||||
<li><a href="{{ serie_page.permalink | safe }}" aria-label="{{ serie_page.title | safe }}">{{ serie_page.title }}</a></li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
</nav>
|
||||
</details>
|
||||
{%- else -%}
|
||||
<div class="page-serie">
|
||||
{{ page_of_a_serie }}<a href="{{ serie_section.permalink | safe }}" aria_label="{{ serie_section.title | safe }}">{{ serie_section.title }}</a>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
49
templates/partials/series_page.html
Normal file
49
templates/partials/series_page.html
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{# Let's retrieve the first section having the `extra.series` parameter set to true #}
|
||||
{# As a series might be a transparent section in order to mix up its articles with those of the section just above or the root, #}
|
||||
{# there is no other way but to compute the potential path of each ancestor section related to the page and look for the first one being a series. #}
|
||||
{# Using the `ancestors` field of a section is not possible because transparent sections are not present in this field. #}
|
||||
{%- set current_path = [] -%}
|
||||
{%- set section_paths = [] -%}
|
||||
{%- for path in page.relative_path | split(pat="/") | slice(end=-1) -%}
|
||||
{%- set_global current_path = current_path | concat(with=path) -%}
|
||||
{%- set section_path = current_path | concat(with="_index.md") | join(sep="/") -%}
|
||||
{%- set_global section_paths = section_paths | concat(with=section_path) -%}
|
||||
{%- endfor -%}
|
||||
{# Let's identify the closest series of the page, if any #}
|
||||
{%- for section_path in section_paths | reverse -%}
|
||||
{%- set section_file_exists = load_data(path=section_path, required=false) -%}
|
||||
{%- if section_file_exists -%}
|
||||
{%- set section = get_section(path=section_path,lang=lang) -%}
|
||||
{%- if "series" in section.extra and section.extra.series -%}
|
||||
{%- set_global series_section = section -%}
|
||||
{%- break -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if series_section -%}
|
||||
{%- set page_of_a_series = macros_translate::translate(key="page_of_a_series", default="This article is part of the serie: ", language_strings=language_strings) -%}
|
||||
{%- if macros_settings::evaluate_setting_priority(setting="series_page_description", page=page, section=series_section, default_global_value="none") == "full" -%}
|
||||
<details class="series-page">
|
||||
<summary>
|
||||
{{ page_of_a_series }}<a href="{{ series_section.permalink | safe }}" aria_label="{{ series_section.title | safe }}">{{ series_section.title }}</a>
|
||||
</summary>
|
||||
{{ series_section.description | safe }}
|
||||
{%- set ordered_series_pages = series_section.pages | reverse -%}
|
||||
<nav>
|
||||
<ol>
|
||||
{%- for series_page in ordered_series_pages -%}
|
||||
{%- if series_page.relative_path == page.relative_path -%}
|
||||
<li>{{ series_page.title }}</li>
|
||||
{%- else -%}
|
||||
<li><a href="{{ series_page.permalink | safe }}" aria-label="{{ series_page.title | safe }}">{{ series_page.title }}</a></li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
</nav>
|
||||
</details>
|
||||
{%- else -%}
|
||||
<div class="series-page">
|
||||
{{ page_of_a_series }}<a href="{{ series_section.permalink | safe }}" aria_label="{{ series_section.title | safe }}">{{ series_section.title }}</a>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
|
@ -12,11 +12,11 @@
|
|||
{% endif -%}
|
||||
|
||||
<article>
|
||||
<div id="serie-title">
|
||||
<span class="title-label">{{ macros_translate::translate(key="serie", default="SERIE", language_strings=language_strings) }}</span>
|
||||
{%- set serie_go_to_posts = macros_translate::translate(key="serie_go_to_posts", default="Go to serie's posts", language_strings=language_strings) -%}
|
||||
<a id="go-to-button" href="#posts-list" class="no-hover-padding" title="{{ serie_go_to_posts }}">
|
||||
{{ serie_go_to_posts }}
|
||||
<div id="series-title">
|
||||
<span class="title-label">{{ macros_translate::translate(key="series", default="SERIES", language_strings=language_strings) }}</span>
|
||||
{%- set series_go_to_posts = macros_translate::translate(key="series_go_to_posts", default="Go to series' posts", language_strings=language_strings) -%}
|
||||
<a id="go-to-button" href="#posts-list" class="no-hover-padding" title="{{ series_go_to_posts }}">
|
||||
{{ series_go_to_posts }}
|
||||
</a>
|
||||
{{ macros_page_header::page_header(title=section.title) }}
|
||||
</div>
|
||||
|
|
@ -26,18 +26,18 @@
|
|||
</section>
|
||||
</article>
|
||||
<div id="posts-list">
|
||||
<div class="serielist-title bottom-divider">
|
||||
{{ macros_translate::translate(key="serie_posts", default="Serie's posts:", language_strings=language_strings) }}
|
||||
<div class="serieslist-title bottom-divider">
|
||||
{{ macros_translate::translate(key="series_posts", default="Series' posts:", language_strings=language_strings) }}
|
||||
</div>
|
||||
<div class="serielist-container">
|
||||
<div class="serieslist-container">
|
||||
{% for post in section.pages | reverse %}
|
||||
{% if loop.last %}
|
||||
<section class="serielist-row">
|
||||
<section class="serieslist-row">
|
||||
{% else %}
|
||||
<section class="serielist-row bottom-divider">
|
||||
<section class="serieslist-row bottom-divider">
|
||||
{% endif %}
|
||||
|
||||
<ul class="serielist-meta">
|
||||
<ul class="serieslist-meta">
|
||||
{{ loop.index }}
|
||||
{% if post.draft %}
|
||||
<li class="draft-label">{{ macros_translate::translate(key="draft", default="DRAFT", language_strings=language_strings) }}</li>
|
||||
|
|
@ -45,12 +45,12 @@
|
|||
</ul>
|
||||
</section>
|
||||
{% if loop.last %}
|
||||
<section class="serielist-row">
|
||||
<section class="serieslist-row">
|
||||
{% else %}
|
||||
<section class="serielist-row bottom-divider">
|
||||
<section class="serieslist-row bottom-divider">
|
||||
{% endif %}
|
||||
<div class="serielist-content">
|
||||
<h2 class="serielist-title">
|
||||
<div class="serieslist-content">
|
||||
<h2 class="serieslist-title">
|
||||
<a href="{{ post.permalink }}">{{ post.title }}</a>
|
||||
</h2>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue