mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
chore: update changelog
This commit is contained in:
@@ -176,20 +176,26 @@ class ImageCDNUploader {
|
||||
let count = 0;
|
||||
changelogIndex.community = changelogIndex.community.map((post) => {
|
||||
if (!post.image) return post;
|
||||
count++;
|
||||
return {
|
||||
...post,
|
||||
image: this.cache[post.image] || post.image,
|
||||
};
|
||||
if (this.cache[post.image]) {
|
||||
count++;
|
||||
return {
|
||||
...post,
|
||||
image: this.cache[post.image],
|
||||
};
|
||||
}
|
||||
return post;
|
||||
});
|
||||
|
||||
changelogIndex.cloud = changelogIndex.cloud.map((post) => {
|
||||
if (!post.image) return post;
|
||||
count++;
|
||||
return {
|
||||
...post,
|
||||
image: this.cache[post.image] || post.image,
|
||||
};
|
||||
if (this.cache[post.image]) {
|
||||
count++;
|
||||
return {
|
||||
...post,
|
||||
image: this.cache[post.image],
|
||||
};
|
||||
}
|
||||
return post;
|
||||
});
|
||||
|
||||
writeJSONSync(changelogIndexPath, changelogIndex, { spaces: 2 });
|
||||
@@ -210,6 +216,10 @@ class ImageCDNUploader {
|
||||
} else {
|
||||
consola.info('No new images to upload.');
|
||||
}
|
||||
|
||||
// 替换文章和 changelog index 中的图片链接
|
||||
this.replaceLinksInPosts();
|
||||
this.replaceLinksInChangelogIndex();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ export const DOCS_DIR = resolve(ROOT, 'docs/changelog');
|
||||
export const CHANGELOG_DIR = resolve(ROOT, 'changelog');
|
||||
export const CHANGELOG_FILE = {
|
||||
v0: resolve(CHANGELOG_DIR, 'CHANGELOG.v0.md'),
|
||||
v1: resolve(ROOT, 'CHANGELOG.md'),
|
||||
v1: resolve(CHANGELOG_DIR, 'CHANGELOG.v1.md'),
|
||||
v2: resolve(ROOT, 'CHANGELOG.md'),
|
||||
};
|
||||
export const STATICS_DIR = resolve(DOCS_DIR, '__statics__');
|
||||
export const CHANGELOG_INDEX = resolve(DOCS_DIR, 'index.json');
|
||||
|
||||
Reference in New Issue
Block a user