Skip to content

Conversation

felix-fly
Copy link
Contributor

What does it do?

Add hour and minute for the post permalink.

How to test

Edit _config.yml file

permalink: :year/:month:day:hour:minute

Screenshots

Pull request tasks

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

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.146% when pulling c32b5fa on felix-fly:master into e8fc2ba on hexojs:master.

@coveralls
Copy link

coveralls commented Jul 19, 2019

Coverage Status

Coverage decreased (-0.006%) to 97.141% when pulling 4a7ac1a on felix-fly:master into e8fc2ba on hexojs:master.

JLHwung
JLHwung previously approved these changes Jul 19, 2019
@felix-fly
Copy link
Contributor Author

Can this be merged?

@tomap
Copy link
Contributor

tomap commented Aug 14, 2019

It looks good, but no unit tests?

@tomap
Copy link
Contributor

tomap commented Aug 14, 2019

https://github.com/hexojs/hexo/blob/master/test/scripts/filters/post_permalink.js#L84

Adding one does not seem complex, based upon existing ones

Can you do one, or do you need help?

it('post_title', () => {
    hexo.config.permalink = ':year/:month/:day/:hour/:minute/:post_title/';

    return Post.insert({
      source: 'sub/2015-05-06-my-new-post.md',
      slug: '2015-05-06-my-new-post',
      title: 'My New Post',
      date: moment('2015-05-06 12:13')
    }).then(post => {
      postPermalink(post).should.eql('2015/05/06/12/13/my-new-post/');
      hexo.config.permalink = PERMALINK;
      return Post.removeById(post._id);
    });
  });

That should be a start :)

tomap
tomap previously approved these changes Aug 18, 2019
@curbengh
Copy link
Contributor

curbengh commented Nov 2, 2019

Just a note that when hour and minute is enabled,

permalink: :year/:month:day:hour:minute

but front-matter of a post doesn't have hour+minute, the permalink will default them to zero, e.g. "2015/05/06/00/00/my-new-post/".

@curbengh curbengh added this to the v4.1.0 milestone Nov 2, 2019
@curbengh
Copy link
Contributor

curbengh commented Nov 2, 2019

CI benchmark doesn't look great, but I believe it's more likely due to Travis is under heavy load (on weekend).

@curbengh curbengh requested a review from a team November 2, 2019 08:58
Copy link
Member

@SukkaW SukkaW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SukkaW
Copy link
Member

SukkaW commented Nov 2, 2019

CI benchmark doesn't look great, but I believe it's more likely due to Travis is under heavy load (on weekend).

@curbengh
We might check https://www.traviscistatus.com/ and triger a rebuild when there are less Active Linux Builds for Open Source projects.

@SukkaW SukkaW merged commit b2a71e7 into hexojs:master Nov 2, 2019
SukkaW added a commit to SukkaW/hexo-site that referenced this pull request Dec 1, 2019
SukkaW added a commit to hexojs/site that referenced this pull request Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants