summaryrefslogtreecommitdiff
path: root/src/util/articleLoader.ts
diff options
context:
space:
mode:
authorFushihara <1039534+fushihara@users.noreply.github.com>2024-09-25 21:35:06 +0900
committerFushihara <1039534+fushihara@users.noreply.github.com>2024-09-25 21:35:06 +0900
commit2b30ba0c4890c2a616c4b4cc8b0b3bc1bb9b3325 (patch)
treea618b0031741ec3b700e35d126613c365e3ae904 /src/util/articleLoader.ts
parent6703973245610272c6cbd747f69f97a3f8f66613 (diff)
記事のタグ、カテゴリの個数を表示するように追加
Diffstat (limited to 'src/util/articleLoader.ts')
-rw-r--r--src/util/articleLoader.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/articleLoader.ts b/src/util/articleLoader.ts
index 1ae0448..f7c7e95 100644
--- a/src/util/articleLoader.ts
+++ b/src/util/articleLoader.ts
@@ -122,6 +122,14 @@ class CategoryTag {
storeCategory.count += 1;
}
}
+ getTagCount(tagName: string) {
+ const data = this.data.get(tagName);
+ if (data == null) {
+ throw new Error(`タグ名:[${tagName}]`);
+ }
+ const count = data.count;
+ return count;
+ }
}
class Article {
constructor(