Skip to content

Commit

Permalink
fix: 修复简书发布报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Nov 8, 2023
1 parent db620b7 commit fbad5ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/adaptors/api/vuepress/vuepressYamlConverterAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class VuepressYamlConverterAdaptor extends YamlConvertAdaptor {
}

// 日记
if (post.title.includes("[日记]")) {
if (post?.title?.includes("[日记]")) {
yamlFormatObj.yamlObj.article = false
}

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/base/baseExtendApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class BaseExtendApi extends WebApi implements IBlogApi, IWebApi {
const post = _.cloneDeep(doc) as Post

if (cfg?.mdFilenameRule) {
if (cfg?.mdFilenameRule.includes("[filename]")) {
if (cfg?.mdFilenameRule?.includes("[filename]")) {
cfg.useMdFilename = true
}
// 处理文件规则
Expand Down Expand Up @@ -237,7 +237,7 @@ class BaseExtendApi extends WebApi implements IBlogApi, IWebApi {
const pathCates = []

// 笔记层级作为文件路径
if (savePath.includes(CATE_AUTO_NAME)) {
if (savePath?.toString().includes(CATE_AUTO_NAME)) {
cfg.usePathCategory = true
}
// 获取笔记层级
Expand Down

0 comments on commit fbad5ee

Please sign in to comment.