samarsault / plainwhite-jekyll

A configurable portfolio-style jekyll theme for writers.
https://samarsault.com
MIT License
460 stars 480 forks source link

Add "read more" link to excerpts #56

Closed jomei closed 4 years ago

jomei commented 4 years ago

Hi! Currently on the posts page it's not obvious that an excerpt is not a full post. I think it would be nice to have some way to add some kind of "read more" link with custom text.

DotIN13 commented 4 years ago

You could fork the repo and add your own Read More button.

You need to modify _layout/home.html: 53, for example as follows:

<div class="post">
{%- if site.show_excerpts -%}
{{ post.excerpt }}
{%- endif -%}
<a class="read-more-link" href="{{ post.url | relative_url }}">Read More</a>
</div>

and _sass/plain.scss as follows

.post {

  .read-more-link {
    font-family: Raleway, sans-serif;
    margin-bottom: 1em;
  }

  p {
    margin-bottom: 0.25rem;
  }
}

tEWQB9.png

jomei commented 4 years ago

Thank you, @DotIN13 It's a good solution =)