forked from deepStateMirrors/tabi
✨ feat: support using info-page.html for sections (#455)
Co-authored-by: welpo <welpo@users.noreply.github.com>
This commit is contained in:
parent
e05860636b
commit
28fe074ea0
5 changed files with 51 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
||||||
+++
|
+++
|
||||||
title = "Domina la configuració de tabi: guia completa"
|
title = "Domina la configuració de tabi: guia completa"
|
||||||
date = 2023-09-18
|
date = 2023-09-18
|
||||||
updated = 2024-11-30
|
updated = 2025-01-02
|
||||||
description = "Descobreix les múltiples maneres en què pots personalitzar tabi."
|
description = "Descobreix les múltiples maneres en què pots personalitzar tabi."
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
|
@ -490,6 +490,17 @@ path = "about"
|
||||||
|
|
||||||
Fixa't com s'estableix `path = "about"`. Zola situarà la pàgina a `$base_url/about/`. Si vols que la pàgina estigui disponible a `/contacte/`, hauries d'establir `path = "contacte"`.
|
Fixa't com s'estableix `path = "about"`. Zola situarà la pàgina a `$base_url/about/`. Si vols que la pàgina estigui disponible a `/contacte/`, hauries d'establir `path = "contacte"`.
|
||||||
|
|
||||||
|
La plantilla `info-page.html` també es pot utilitzar per crear landing pages a la ruta arrel (`"/"`). Per fer-ho, l'arxiu `content/_index.md` hauria de ser així:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
+++
|
||||||
|
title = "Títol de la pàgina"
|
||||||
|
template = "info-page.html"
|
||||||
|
+++
|
||||||
|
|
||||||
|
Contingut amb Markdown.
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## SEO
|
## SEO
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
+++
|
+++
|
||||||
title = "Domina la configuración de tabi: guía completa"
|
title = "Domina la configuración de tabi: guía completa"
|
||||||
date = 2023-09-18
|
date = 2023-09-18
|
||||||
updated = 2024-11-30
|
updated = 2025-01-02
|
||||||
description = "Descubre las múltiples maneras en que puedes personalizar tabi."
|
description = "Descubre las múltiples maneras en que puedes personalizar tabi."
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
|
@ -490,6 +490,17 @@ path = "about"
|
||||||
|
|
||||||
Fíjate cómo se establece `path = "about"`. Zola colocará la página en `$base_url/about/`. Si deseas que la página esté disponible en `/contacto/`, tendrías que establecer `path = "contacto"`.
|
Fíjate cómo se establece `path = "about"`. Zola colocará la página en `$base_url/about/`. Si deseas que la página esté disponible en `/contacto/`, tendrías que establecer `path = "contacto"`.
|
||||||
|
|
||||||
|
La plantilla `info-page.html` también se puede utilizar para crear lading pages en la ruta raíz (`"/"`). Para hacerlo, el archivo `content/_index.md` debería verse así:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
+++
|
||||||
|
title = "Título de la página"
|
||||||
|
template = "info-page.html"
|
||||||
|
+++
|
||||||
|
|
||||||
|
Contenido con Markdown.
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## SEO
|
## SEO
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
+++
|
+++
|
||||||
title = "Mastering tabi Settings: A Comprehensive Guide"
|
title = "Mastering tabi Settings: A Comprehensive Guide"
|
||||||
date = 2023-09-18
|
date = 2023-09-18
|
||||||
updated = 2024-11-30
|
updated = 2025-01-02
|
||||||
description = "Discover the many ways you can customise your tabi site."
|
description = "Discover the many ways you can customise your tabi site."
|
||||||
|
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
|
@ -495,6 +495,17 @@ path = "about"
|
||||||
|
|
||||||
Notice how the `path` is set to `about`. Zola will place the page at `$base_url/about/`. If you'd like to have the page available at `/contact/`, you'd set `path = "contact"`.
|
Notice how the `path` is set to `about`. Zola will place the page at `$base_url/about/`. If you'd like to have the page available at `/contact/`, you'd set `path = "contact"`.
|
||||||
|
|
||||||
|
The `info-page.html` template can also be used to create landing pages at the path root (`"/"`). To do that, the `content/_index.md` file should look like this:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
+++
|
||||||
|
title = "Landing Page Title"
|
||||||
|
template = "info-page.html"
|
||||||
|
+++
|
||||||
|
|
||||||
|
Place your landing page Markdown content here.
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## SEO
|
## SEO
|
||||||
|
|
|
@ -4,13 +4,15 @@
|
||||||
|
|
||||||
{%- block main_content %}
|
{%- block main_content %}
|
||||||
|
|
||||||
{{ macros_page_header::page_header(title=page.title) }}
|
{%- set page_or_section = page | default(value=section) -%}
|
||||||
|
|
||||||
|
{{ macros_page_header::page_header(title=page_or_section.title) }}
|
||||||
|
|
||||||
<div id="page-content">
|
<div id="page-content">
|
||||||
<main>
|
<main>
|
||||||
{# The replace pattern is used to enable arbitrary locations for the Table of Contents #}
|
{# The replace pattern is used to enable arbitrary locations for the Table of Contents #}
|
||||||
{# This is Philipp Oppermann's workaround: https://github.com/getzola/zola/issues/584#issuecomment-474329637 #}
|
{# This is Philipp Oppermann's workaround: https://github.com/getzola/zola/issues/584#issuecomment-474329637 #}
|
||||||
{{ page.content | replace(from="<!-- toc -->", to=macros_toc::toc(page=page, header=false, language_strings=language_strings)) | safe }}
|
{{ page_or_section.content | replace(from="<!-- toc -->", to=macros_toc::toc(page=page_or_section, header=false, language_strings=language_strings)) | safe }}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
{%- set page_or_section = page | default(value=section) -%}
|
{%- set page_or_section = page | default(value=section) -%}
|
||||||
|
|
||||||
|
{# prepare parameters for evaluate_setting_priority macro #}
|
||||||
|
{%- set page_s = page | default(value="") -%}
|
||||||
|
{%- set section_s = section | default(value="") -%}
|
||||||
|
|
||||||
{# Quick navigation buttons #}
|
{# Quick navigation buttons #}
|
||||||
{% if macros_settings::evaluate_setting_priority(setting="quick_navigation_buttons", page=page_or_section, default_global_value=false) == "true" %}
|
{% if macros_settings::evaluate_setting_priority(setting="quick_navigation_buttons", page=page_s, section=section_s, default_global_value=false) == "true" %}
|
||||||
<div id="button-container">
|
<div id="button-container">
|
||||||
{# Button to go show a floating Table of Contents #}
|
{# Button to go show a floating Table of Contents #}
|
||||||
{% if page_or_section.toc %}
|
{% if page_or_section.toc %}
|
||||||
|
@ -31,13 +36,13 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Add KaTeX functionality #}
|
{# Add KaTeX functionality #}
|
||||||
{%- if macros_settings::evaluate_setting_priority(setting="katex", page=page_or_section, default_global_value=false) == "true" -%}
|
{%- if macros_settings::evaluate_setting_priority(setting="katex", page=page_s, section=section_s, default_global_value=false) == "true" -%}
|
||||||
<link rel="stylesheet" href="{{ get_url(path='katex.min.css', trailing_slash=false) | safe }}">
|
<link rel="stylesheet" href="{{ get_url(path='katex.min.css', trailing_slash=false) | safe }}">
|
||||||
<script defer src="{{ get_url(path='js/katex.min.js', trailing_slash=false) | safe }}"></script>
|
<script defer src="{{ get_url(path='js/katex.min.js', trailing_slash=false) | safe }}"></script>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{# Load mermaid.js #}
|
{# Load mermaid.js #}
|
||||||
{%- if macros_settings::evaluate_setting_priority(setting="mermaid", page=page_or_section, default_global_value=false) == "true" -%}
|
{%- if macros_settings::evaluate_setting_priority(setting="mermaid", page=page_s, section=section_s, default_global_value=false) == "true" -%}
|
||||||
{%- if config.extra.serve_local_mermaid | default(value=true) -%}
|
{%- if config.extra.serve_local_mermaid | default(value=true) -%}
|
||||||
<script defer src="{{ get_url(path='js/mermaid.min.js', trailing_slash=false) | safe }}"></script>
|
<script defer src="{{ get_url(path='js/mermaid.min.js', trailing_slash=false) | safe }}"></script>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
|
@ -46,7 +51,7 @@
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{# Add copy button to code blocks #}
|
{# Add copy button to code blocks #}
|
||||||
{%- if macros_settings::evaluate_setting_priority(setting="copy_button", page=page_or_section, default_global_value=true) == "true" -%}
|
{%- if macros_settings::evaluate_setting_priority(setting="copy_button", page=page_s, section=section_s, default_global_value=true) == "true" -%}
|
||||||
{#- Add hidden HTML elements with the translated strings for the button's interactions -#}
|
{#- Add hidden HTML elements with the translated strings for the button's interactions -#}
|
||||||
<span id="copy-success" class="hidden">
|
<span id="copy-success" class="hidden">
|
||||||
{{ macros_translate::translate(key="copied", default="Copied!", language_strings=language_strings) }}
|
{{ macros_translate::translate(key="copied", default="Copied!", language_strings=language_strings) }}
|
||||||
|
@ -58,11 +63,11 @@
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{# JavaScript to use the "Show source or path" on code blocks shortcode: https://welpo.github.io/tabi/blog/shortcodes/#show-source-or-path #}
|
{# JavaScript to use the "Show source or path" on code blocks shortcode: https://welpo.github.io/tabi/blog/shortcodes/#show-source-or-path #}
|
||||||
{%- if macros_settings::evaluate_setting_priority(setting="add_src_to_code_block", page=page_or_section, default_global_value=false) == "true" -%}
|
{%- if macros_settings::evaluate_setting_priority(setting="add_src_to_code_block", page=page_s, section=section_s, default_global_value=false) == "true" -%}
|
||||||
<script defer src="{{ get_url(path='js/addSrcToCodeBlock.min.js', trailing_slash=false) | safe }}"></script>
|
<script defer src="{{ get_url(path='js/addSrcToCodeBlock.min.js', trailing_slash=false) | safe }}"></script>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{# Add backlinks to footnotes #}
|
{# Add backlinks to footnotes #}
|
||||||
{%- if macros_settings::evaluate_setting_priority(setting="footnote_backlinks", page=page_or_section, default_global_value=false) == "true" -%}
|
{%- if macros_settings::evaluate_setting_priority(setting="footnote_backlinks", page=page_s, section=section_s, default_global_value=false) == "true" -%}
|
||||||
<script defer src="{{ get_url(path='js/footnoteBacklinks.min.js', trailing_slash=false | safe )}}"></script>
|
<script defer src="{{ get_url(path='js/footnoteBacklinks.min.js', trailing_slash=false | safe )}}"></script>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue