From a04e54d9fed5760e6843b74d20e8df63b8d890c6 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 30 May 2022 22:43:55 -0700 Subject: Add Page.summary fallback and Add Katex --- templates/base.html | 12 ++++++++++-- templates/index.html | 12 +++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/base.html b/templates/base.html index 18e1fb4..d148811 100644 --- a/templates/base.html +++ b/templates/base.html @@ -127,10 +127,18 @@ {% endif %} {% if config.build_search_index %} - - + + {% endif %} + {% if config.extra.katex_enabled %} + + + + {% if config.extra.katex_auto_render %} + + {% endif %} + {% endif %} {% block extra_head %}{% endblock extra_head %} diff --git a/templates/index.html b/templates/index.html index 79e187a..f0740fe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,7 +6,17 @@ {% for page in paginator.pages %}
{{ macros::title(page=page) }} -

{{ page.summary | markdown(inline=true) | safe }} ...more

+

+ {% if page.summary -%} + {{ page.summary | markdown(inline=true) | safe }} + {% elif page.description %} + {{ page.description | safe }} + {% elif page.content %} + {{ page.content | safe | striptags | truncate(length=150) }} + {% elif page.extra.static_thumbnail %} + {% endif -%} + ...more +

{% endfor %}