Skip to content

feat(filter): use existing excerpt if possible#3612

Merged
yoshinorin merged 2 commits intohexojs:masterfrom
ppoffice:master
Jul 27, 2019
Merged

feat(filter): use existing excerpt if possible#3612
yoshinorin merged 2 commits intohexojs:masterfrom
ppoffice:master

Conversation

@ppoffice
Copy link
Contributor

@ppoffice ppoffice commented Jul 4, 2019

What does it do?

Skip excerpt generation for posts or pages if it is set in the front matter. This gives users the ability to write down whatever abstract they want instead of just showing begining part of the post.

For example:

title: An article about blah blah blah
excerpt: This article is all about blah blah blah blah blah blah
---
Actual markdown content...

will generate:

{
    excerpt: 'This article is all about blah blah blah blah blah blah',
    more: 'Actual markdown content...',
    content: 'Actual markdown content...'
}

How to test

git clone -b BRANCH https://github.com/ppoffice/hexo.git
cd hexo
npm install
npm test

Screenshots

N/A

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@coveralls
Copy link

coveralls commented Jul 4, 2019

Coverage Status

Coverage increased (+0.002%) to 97.15% when pulling c321663 on ppoffice:master into f2ddc99 on hexojs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 97.15% when pulling d819f18 on ppoffice:master into f2ddc99 on hexojs:master.

@curbengh
Copy link
Contributor

curbengh commented Jul 9, 2019

I prefer this approach (using it myself) than <!--more-->, looks cleaner. <!--more--> does have the advantage of supporting formatting though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants