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

merge v7.0.0 branch #5222

Merged
merged 23 commits into from
Oct 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
148ed7c
refactor: migrate typescript (#5092)
stevenjoezhang Mar 15, 2023
46fbdcf
release: `v7.0.0-rc1` (#5176)
yoshinorin Mar 18, 2023
8251df3
feat: add exclude_languages feature to prismjs (#5182)
D-Sketon Apr 20, 2023
725422a
Refactor types (#5178)
Pcrab Apr 20, 2023
c62909d
fix(backtick_code): handle empty code blocks (#5206)
stevenjoezhang May 20, 2023
f791362
chore: change dependencies version (#5202)
Pcrab May 31, 2023
5837bb8
feat(tags/post_link): use slug when title is empty (#5220)
stevenjoezhang Jun 2, 2023
5ee3e6d
test: improve coverage (#5221)
D-Sketon Jun 2, 2023
c9ad8c6
feat: add url_for and full_url_for tag plugins (#5198)
D-Sketon Jun 3, 2023
7157e85
feat: allow top-level await in plugins or scripts (#5228)
Pcrab Jun 16, 2023
3eaafb4
fix(moize): helper function not working fine with relative_url (#5217)
D-Sketon Jul 9, 2023
04bc704
test: improve coverage (#5223)
D-Sketon Jul 9, 2023
b3b444d
release: `v7.0.0-rc2` (#5238)
yoshinorin Jul 11, 2023
0257bb3
fix typo (#5245)
stevenjoezhang Jul 25, 2023
99e94cc
feat(post): remove front-matter property `link` (#5253)
stevenjoezhang Jul 27, 2023
5d8dcec
Revert "fix(backtick_code): handle empty code blocks (#5206)" (#5257)
stevenjoezhang Aug 1, 2023
35ceaae
fix(post): skip_render not working in post_asset_folder (#5258)
D-Sketon Aug 1, 2023
24a7b61
feat: define global variable hexo (#5242)
dimaslanjaka Aug 10, 2023
d29d774
chore(lint-staged): remove `git-exec-and-restage` (#5281)
uiolee Aug 31, 2023
7b588e7
ci: reduce the running of ci (#5282)
uiolee Sep 1, 2023
3059fa0
perf(post): cache tags getter (#5145)
SukkaW Oct 21, 2023
fcc6168
Merge branch 'master' into v7.0.0
yoshinorin Oct 22, 2023
2a2cc9a
revert: Access data files from source folder (#1969) (#5325)
stevenjoezhang Oct 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(post): remove front-matter property link (#5253)
stevenjoezhang authored Jul 27, 2023
commit 99e94cc452693b70cbbe61bfb326fb3072a77cbf
1 change: 0 additions & 1 deletion lib/models/post.ts
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ export = ctx => {
source: {type: String, required: true},
slug: {type: String, required: true},
photos: [String],
link: {type: String, default: ''},
raw: {type: String, default: ''},
published: {type: Boolean, default: true},
content: {type: String},
4 changes: 0 additions & 4 deletions lib/plugins/processor/post.ts
Original file line number Diff line number Diff line change
@@ -159,10 +159,6 @@ function processPost(ctx, file) {
data.photos = [data.photos];
}

if (data.link && !data.title) {
data.title = data.link.replace(/^https?:\/\/|\/$/g, '');
}

if (data.permalink) {
data.__permalink = data.permalink;
data.permalink = undefined;
1 change: 0 additions & 1 deletion test/scripts/models/post.js
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ describe('Post', () => {
data.comments.should.be.true;
data.layout.should.eql('post');
data._content.should.eql('');
data.link.should.eql('');
data.raw.should.eql('');
data.published.should.be.true;
should.not.exist(data.updated);
28 changes: 1 addition & 27 deletions test/scripts/processors/post.js
Original file line number Diff line number Diff line change
@@ -778,33 +778,7 @@ describe('post', () => {
]);
});

it('post - link without title', async () => {
const body = [
'link: https://hexo.io/',
'---'
].join('\n');

const file = newFile({
path: 'foo.html',
published: true,
type: 'create',
renderable: true
});

await writeFile(file.source, body);
await process(file);
const post = Post.findOne({ source: file.path });

post.link.should.eql('https://hexo.io/');
post.title.should.eql('hexo.io');

return Promise.all([
post.remove(),
unlink(file.source)
]);
});

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

const file = newFile({