Skip to content

Commit

Permalink
feat: slug not use alias as default
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Nov 27, 2024
1 parent 1e69ff6 commit 57b6266
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions libs/zhi-siyuan-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# zhi-siyuan-api

## 2.24.0

### Minor Changes

- feat: slug not use alias as default

## 2.23.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-siyuan-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-siyuan-api",
"version": "2.23.1",
"version": "2.24.0",
"type": "module",
"description": "a siyuan-note api including both kernel and client",
"main": "./dist/index.js",
Expand Down
5 changes: 3 additions & 2 deletions libs/zhi-siyuan-api/src/lib/adaptor/siYuanApiAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ class SiYuanApiAdaptor extends BlogApi {
}

// 别名(Custom_Slug优先,没有默认获取Sys_alias)
const alias = ObjectUtil.getProperty(attrs, SiyuanAttr.Sys_alias, "")
const slug = ObjectUtil.getProperty(attrs, SiyuanAttr.Custom_slug, alias)
// const alias = ObjectUtil.getProperty(attrs, SiyuanAttr.Sys_alias, "")
// const slug = ObjectUtil.getProperty(attrs, SiyuanAttr.Custom_slug, alias)
const slug = ObjectUtil.getProperty(attrs, SiyuanAttr.Custom_slug, "")

// 永久链接
const plink = `siyuan://blocks/${siyuanPost.root_id}`
Expand Down

0 comments on commit 57b6266

Please sign in to comment.