From ff5640991ea5ac8d0e5dcd093e204f2aead10b34 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Tue, 2 Jun 2020 12:02:01 +0800 Subject: [PATCH] Posts without title should be accessible --- lib/plugins/processor/post.js | 4 ---- test/scripts/processors/post.js | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/plugins/processor/post.js b/lib/plugins/processor/post.js index 4856d44caa..516822ae38 100644 --- a/lib/plugins/processor/post.js +++ b/lib/plugins/processor/post.js @@ -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; diff --git a/test/scripts/processors/post.js b/test/scripts/processors/post.js index d544d44b15..ebdf173097 100644 --- a/test/scripts/processors/post.js +++ b/test/scripts/processors/post.js @@ -615,7 +615,6 @@ describe('post', () => { unlink(file.source); }); - it('post - link without title and link', async () => { const body = ''; @@ -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);