From 2d389272f1f0efc01f2a958f17e1ed73578d5917 Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Sat, 26 Aug 2023 16:28:58 +0800 Subject: feat: rich excerpt with image support (#125) --- _includes/views/pagination-item.html | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to '_includes/views/pagination-item.html') diff --git a/_includes/views/pagination-item.html b/_includes/views/pagination-item.html index fff6541..791fcda 100644 --- a/_includes/views/pagination-item.html +++ b/_includes/views/pagination-item.html @@ -4,11 +4,29 @@ {% assign lang = post.lang %} {%- include functions.html func='get_reading_time' -%} {% assign reading_time = return %} + {%- include functions.html func='get_article_excerpt' -%} {% assign excerpt = return %} {%- assign post_url = post.url | relative_url -%} -
  • +{%- assign name = 'excerpt.image_width' -%} +{%- include functions.html func='get_value' -%} +{%- assign image_width = return | default: '38.2%' -%} + +{%- assign name = 'excerpt.image_height' -%} +{%- include functions.html func='get_value' -%} +{%- assign image_height = return | default: '160px' -%} + +{%- assign name = 'excerpt.default_image' -%} +{%- include functions.html func='get_value' -%} +{%- assign default_image = return -%} + +{%- assign post_image = post.banner.image + | default: post.banner + | default: default_image + | default: '/assets/images/default-image.jpeg' -%} + +
  • {{ post.title | escape }} @@ -22,11 +40,16 @@ {%- endif -%} {{ reading_time }} - -

    - {{ excerpt }} Read More -

    -
    +
    + {%- if post_image -%} + +
    +
    + {%- endif -%} + +

    {{ excerpt }} Read More

    +
    +