Skip to content

Commit

Permalink
fix: update EHTTag and TagItem interfaces to require intro and links …
Browse files Browse the repository at this point in the history
…properties
  • Loading branch information
OpportunityLiu committed Feb 7, 2025
1 parent 9b8042e commit 48d844c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export interface EHTNamespace {

export interface EHTTag {
name: string;
intro?: string;
links?: string;
intro: string;
links: string;
}

export interface TagItem extends EHTTag {
Expand All @@ -54,7 +54,7 @@ export interface TagItem extends EHTTag {
/** 去除 emoji 和图片等的名称 */
cn: string;
/** 用于搜索的简介 */
introSearch?: string;
introSearch: string;
}

export type TagMap = Record<string, TagItem>;
Expand Down
6 changes: 2 additions & 4 deletions src/plugin/introduce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,8 @@ export class Introduce {
</div>
<div class="ehs-content">
${
tagData.intro
? tagData.intro
: `
<div class="ehs-no-intro">
tagData.intro ||
`<div class="ehs-no-intro">
<h3>无介绍</h3>
<center><a href="${editorUrl}" target="_blank">提供介绍</a></center>
</div> `
Expand Down
2 changes: 2 additions & 0 deletions src/plugin/tag-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export class TagDatabase {
key,
name: name,
cn: this.tagging.removeImagesAndEmoji(name),
intro: '',
links: '',
introSearch: '',
};
if (t.intro) {
Expand Down

0 comments on commit 48d844c

Please # to comment.