cotes2020 / jekyll-theme-chirpy

A minimal, responsive, and feature-rich Jekyll theme for technical writing.
https://chirpy.cotes.page
MIT License
7.19k stars 5.67k forks source link

Does chirpy support <!--more--> to separate contents for homepage and detailed page? #709

Closed sirlis closed 1 year ago

sirlis commented 1 year ago

Checklist

Description

In the early version of chirpy, I can use <!--more--> to separate contents and automatically generate an abstract for homepage. Contents before it will show on the homepage after the post title just like an abstract, contents after that will show only in the detailed post. However, after updating the theme to the latest version, this function seems to be unsupported.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

sirlis commented 1 year ago

Just leave a comment to see if this question can be solved.

dineshkoravi commented 1 year ago

I have not used the previous versions, but the latest version does not separate content from excerpt on the home page. It would be nice to have this because first Heading of the post is visible in front page and does not look nice to be in description of post.

sirlis commented 1 year ago

I have not used the previous versions, but the latest version does not separate content from excerpt on the home page. It would be nice to have this because first Heading of the post is visible in front page and does not look nice to be in description of post.

I hope this function could be supported in the future release.

bykhov commented 1 year ago

Support of excerpt_separator will be very appreciated.

sirlis commented 1 year ago

Support of excerpt_separator will be very appreciated.

I've managed to solve the problem by modifying the original code. However I forgot how to do it... See my blog here if it is helpful.

In addition, Jekyll supports excerpt_separator (according to here), however chirpy doesn't support it.

bykhov commented 1 year ago

Thanks! I have followed your commit and it works!

dineshkoravi commented 1 year ago

could i get this commit and still get updates from chirpy with out issues ?

sirlis commented 1 year ago

could i get this commit and still get updates from chirpy with out issues ?

recently I updated my blog through chirpy starter and lost the excerpt_separator ability. I think I should modify _layouts/home.html after each update.

  <div class="card-text post-content mt-0 mb-2">
    <p>
      <!-- {% include no-linenos.html content=post.content %} -->
      {% include no-linenos.html content=post.excerpt %}
      {{ content | markdownify | strip_html | truncate: 200 | escape }}
    </p>
  </div>

may work.