Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Jul 27, 2019

Conversation

@ppoffice
Copy link
Contributor

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

coveralls commented Jul 4, 2019

Coverage Status

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

@curbengh

This comment has been minimized.

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.

@YoshinoriN YoshinoriN added this to the v4.0.0 milestone Jul 10, 2019
@curbengh curbengh mentioned this pull request Jul 25, 2019
2 of 2 tasks complete
@YoshinoriN YoshinoriN merged commit 4931608 into hexojs:master Jul 27, 2019
4 checks passed
4 checks passed
codeclimate All good!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.002%) to 97.15%
Details
@curbengh curbengh mentioned this pull request Aug 31, 2019
1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.