Skip to content

Commit

Permalink
revert: retain empty title behavior for posts (#4344)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Jun 2, 2020
1 parent e5e898c commit 0127d4d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions lib/plugins/processor/post.js
Expand Up @@ -120,10 +120,6 @@ module.exports = ctx => {
data.title = data.link.replace(/^https?:\/\/|\/$/g, '');
}

if (!data.title) {
data.title = data.slug;
}

if (data.permalink) {
data.slug = data.permalink;
delete data.permalink;
Expand Down
3 changes: 1 addition & 2 deletions test/scripts/processors/post.js
Expand Up @@ -615,7 +615,6 @@ describe('post', () => {
unlink(file.source);
});


it('post - link without title and link', async () => {
const body = '';

Expand All @@ -630,7 +629,7 @@ describe('post', () => {
await process(file);
const post = Post.findOne({source: file.path});

post.title.should.eql('foo');
post.title.should.eql('');

post.remove();
unlink(file.source);
Expand Down

0 comments on commit 0127d4d

Please sign in to comment.