feat: render markdown in page titles & descriptions (#486)

Co-authored-by: welpo <welpo@users.noreply.github.com>
This commit is contained in:
stalkerGH 2025-02-15 14:33:37 +01:00 committed by GitHub
parent a5ab6259c6
commit 6837f6f4f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@
{{ post.date | date(format="%d %b", locale=date_locale) }}
</span>
</div>
<a href="{{ post.permalink }}" title="{{ post.title }}">{{ post.title }}</a>
<a href="{{ post.permalink }}" title="{{ post.title }}">{{ post.title | markdown(inline=true) | safe }}</a>
</li>
{% endfor %}
</ul>

View file

@ -108,7 +108,7 @@ Current section extra: {% if current_section %}{{ current_section.extra | json_e
<main>
<article>
<h1 class="article-title">
{{ page.title }}
{{ page.title | markdown(inline=true) | safe }}
</h1>
<ul class="meta">
@ -297,13 +297,13 @@ Current section extra: {% if current_section %}{{ current_section.extra | json_e
<div>
{%- if left_link and left_label and left_title -%}
<a href="{{ left_link | safe }}" aria-label="{{ left_label }}" aria-describedby="left_title"><span class="arrow"></span>&nbsp;{{ left_label }}</a>
<p aria-hidden="true" id="left_title">{{ left_title | truncate(length=100, end="…") }}</p>
<p aria-hidden="true" id="left_title">{{ left_title | truncate(length=100, end="…") | markdown(inline=true) | safe }}</p>
{%- endif -%}
</div>
<div>
{%- if right_link and right_label and right_title -%}
<a href="{{ right_link | safe }}" aria-label="{{ right_label }}" aria-describedby="right_title">{{ right_label }}&nbsp;<span class="arrow"></span></a>
<p aria-hidden="true" id="right_title">{{ right_title | truncate(length=100, end="…") }}</p>
<p aria-hidden="true" id="right_title">{{ right_title | truncate(length=100, end="…") | markdown(inline=true) | safe }}</p>
{%- endif -%}
</div>
</nav>

View file

@ -38,10 +38,10 @@
{% endif %}
<div class="card-info">
<h2 class="card-title">{{ page.title }}</h2>
<h2 class="card-title">{{ page.title | markdown(inline=true) | safe }}</h2>
<div class="card-description">
{% if page.description %}
{{ page.description }}
{{ page.description | markdown(inline=true) | safe }}
{% endif %}
</div>
</div>