From b576da99a8b7d1cbf95506a63177f7174190bbc4 Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Fri, 22 Sep 2023 21:28:42 +0800 Subject: feat: custom excerpt image support Add new front meta named `excerpt_image` to custom excerpt image, which priority is higher than banner image. --- _includes/views/pagination-item.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/_includes/views/pagination-item.html b/_includes/views/pagination-item.html index 791fcda..0b31a3c 100644 --- a/_includes/views/pagination-item.html +++ b/_includes/views/pagination-item.html @@ -1,12 +1,12 @@ {%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%} -{% assign article = post.content %} -{% assign lang = post.lang %} +{%- assign article = post.content -%} +{%- assign lang = post.lang -%} {%- include functions.html func='get_reading_time' -%} -{% assign reading_time = return %} +{%- assign reading_time = return -%} {%- include functions.html func='get_article_excerpt' -%} -{% assign excerpt = return %} +{%- assign article_excerpt = return -%} {%- assign post_url = post.url | relative_url -%} {%- assign name = 'excerpt.image_width' -%} @@ -21,7 +21,8 @@ {%- include functions.html func='get_value' -%} {%- assign default_image = return -%} -{%- assign post_image = post.banner.image +{%- assign post_image = post.excerpt_image + | default: post.banner.image | default: post.banner | default: default_image | default: '/assets/images/default-image.jpeg' -%} @@ -47,7 +48,7 @@ {%- endif -%} -

{{ excerpt }} Read More

+

{{ article_excerpt }} Read More

-- cgit v1.2.3