Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

feat: add supports for automatic slug generation #831

Merged
merged 2 commits into from
Jan 30, 2023

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Jan 21, 2023

What type of PR is this?

/kind feature
/milestone 2.2.x

What this PR does / why we need it:

文章、独立页面、分类、标签支持自动生成别名。

策略:

  1. 仅在创建时会自动根据标题或者名称自动生成别名,编辑时如果需要重新生成,可以点击输入框右侧的按钮。
  2. 中文会被转为拼音并用 - 隔开,需要注意多音字的情况,目前无法保证多音字是否符合预期。
  3. 使用了 https://www.npmjs.com/package/transliteration 库。

Which issue(s) this PR fixes:

Fixes halo-dev/halo#3171

Screenshots:

image

Special notes for your reviewer:

测试方式:

  1. 需要 pnpm install
  2. 测试文章、独立页面、分类、标签创建时,是否可以自动设置别名。
  3. 测试别名输入框右侧的生成别名按钮是否正常工作。
  4. 测试分类和标签选择器创建新分类或标签时,是否正确设置了别名。

Does this PR introduce a user-facing change?

Console 端的文章、独立页面、分类、标签支持自动生成别名

@f2c-ci-robot f2c-ci-robot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jan 21, 2023
@vercel
Copy link

vercel bot commented Jan 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
ui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 21, 2023 at 7:52AM (UTC)

@f2c-ci-robot f2c-ci-robot bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 21, 2023
@f2c-ci-robot f2c-ci-robot bot requested a review from JohnNiang January 21, 2023 07:48
@f2c-ci-robot f2c-ci-robot bot added this to the 2.2.x milestone Jan 21, 2023
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works very well.

image

/approve

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jan 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 28, 2023
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 4c8bb05 into halo-dev:main Jan 30, 2023
@JohnNiang JohnNiang modified the milestones: 2.2.x, 2.2.0 Jan 30, 2023
@ruibaby ruibaby deleted the feat/automitic-slug branch January 30, 2023 07:13
JohnNiang pushed a commit to JohnNiang/halo that referenced this pull request Mar 2, 2023
#### What type of PR is this?

/kind feature
/milestone 2.2.x

#### What this PR does / why we need it:

文章、独立页面、分类、标签支持自动生成别名。

策略:

1. 仅在创建时会自动根据标题或者名称自动生成别名,编辑时如果需要重新生成,可以点击输入框右侧的按钮。
2. 中文会被转为拼音并用 - 隔开,需要注意多音字的情况,目前无法保证多音字是否符合预期。
3. 使用了 https://www.npmjs.com/package/transliteration 库。

#### Which issue(s) this PR fixes:

Fixes halo-dev#3171

#### Screenshots:

<img width="782" alt="image" src="https://user-images.githubusercontent.com/21301288/213849446-18d70974-7b2c-420c-bd50-93d2c3193895.png">

#### Special notes for your reviewer:

测试方式:

1. 需要 `pnpm install`
4. 测试文章、独立页面、分类、标签创建时,是否可以自动设置别名。
5. 测试别名输入框右侧的生成别名按钮是否正常工作。
6. 测试分类和标签选择器创建新分类或标签时,是否正确设置了别名。

#### Does this PR introduce a user-facing change?

```release-note
Console 端的文章、独立页面、分类、标签支持自动生成别名
```
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

支持自动将文章标题的拼音设置为别名
3 participants