diff options
author | jeffreytse <jeffreytse.mail@gmail.com> | 2021-05-25 16:38:40 +0800 |
---|---|---|
committer | jeffreytse <jeffreytse.mail@gmail.com> | 2021-05-26 21:46:29 +0800 |
commit | c718e7e62faf8ccb7fb354a685dfccd3dd669474 (patch) | |
tree | b6f1d462407c0c757c05a8aea867418ca9e6be32 /_includes/views | |
parent | 9eda84bcaad5f631186fa86259bebbf4dc66bddb (diff) |
feat: better post excerpt of pagination
Add "Read More" to the end of post excerpt, and support to click
the excerpt to open the post.
Diffstat (limited to '_includes/views')
-rw-r--r-- | _includes/views/pagination.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/_includes/views/pagination.html b/_includes/views/pagination.html index fc44534..88be011 100644 --- a/_includes/views/pagination.html +++ b/_includes/views/pagination.html @@ -18,9 +18,9 @@ {% assign reading_time = return %} {%- include functions.html func='get_article_excerpt' -%} {% assign excerpt = return %} + {%- assign post_url = post.url | relative_url -%} <h2 class="post-title"> - {%- assign post_url = post.url | relative_url -%} <a class="post-link" href="{{ post_url }}"> {{ post.title | escape }} </a> @@ -29,9 +29,11 @@ <span class="post-date"><i class="fa fa-calendar"></i> {{ post.date | date: date_format }}</span> <span class="post-reading-time left-vsplit"><i class="fa fa-clock-o"></i> {{ reading_time }}</span> </div> - <p class="post-excerpt"> - {{ excerpt }} - </p> + <a class="post-excerpt" href="{{ post_url }}"> + <p> + {{ excerpt }} <span class="read_more">Read More</span> + </p> + </a> <div class="post-tags"> {%- for tag in post.tags -%} <a class="post-tag" href="{{ '/tags.html ' | relative_url }}#{{tag}}">#{{tag}}</a> |