Skip to content

Commit

Permalink
feat: 掘金使用别名标签,新增 getTags 方法、slugTagEnabled 属性
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Sep 7, 2023
1 parent 546fec2 commit f1b2b2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/adaptors/web/juejin/juejinConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ export class JuejinConfig extends CommonWebConfig {
this.pageType = PageTypeEnum.Markdown
this.passwordType = PasswordType.PasswordType_Cookie
this.usernameEnabled = false
this.tagEnabled = true
this.tagEnabled = false
this.slugTagEnabled = true

Check failure on line 41 in src/adaptors/web/juejin/juejinConfig.ts

View workflow job for this annotation

GitHub Actions / ci

Property 'slugTagEnabled' does not exist on type 'JuejinConfig'. Did you mean 'tagEnabled'?
this.cateEnabled = false
this.categoryType = CategoryTypeEnum.CategoryType_Single
this.knowledgeSpaceEnabled = true
this.knowledgeSpaceTitle = "分类"
this.knowledgeSpaceType = CategoryTypeEnum.CategoryType_Single
this.allowKnowledgeSpaceChange = false
this.placeholder.knowledgeSpaceReadonlyModeTip =
"由于掘金平台的限制,暂时不支持编辑所属专栏。如果您想移动文档,请先点击取消删除该文档,然后重新选择新的专栏发布"
this.allowKnowledgeSpaceChange = true
}
}
11 changes: 9 additions & 2 deletions src/adaptors/web/juejin/useJuejinWeb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,15 @@ const useJuejinWeb = async (key?: string, newCfg?: JuejinConfig) => {
}
}

cfg.tagEnabled = true
// 掘金使用单选分类
// 注意:
// 分类和知识空间可以共存。但是共存的前提是。知识空间使用getCategories,分类使用getCategoryTreeNodes
// 分类使用getCategories时候,不能开启知识空间
//
// 标签和别名标签不能共存
//
// 掘金使用单选分类、别名标签
cfg.tagEnabled = false
cfg.slugTagEnabled = true

Check failure on line 92 in src/adaptors/web/juejin/useJuejinWeb.ts

View workflow job for this annotation

GitHub Actions / ci

Property 'slugTagEnabled' does not exist on type 'JuejinConfig'. Did you mean 'tagEnabled'?
cfg.cateEnabled = false
cfg.knowledgeSpaceEnabled = true
cfg.knowledgeSpaceTitle = "分类"
Expand Down

0 comments on commit f1b2b2d

Please sign in to comment.