mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 13:38:33 +02:00
refactor(content-{blog,docs}): unify handling of tags (#7117)
This commit is contained in:
parent
ca718ccac0
commit
1156be3f20
24 changed files with 170 additions and 178 deletions
|
@ -228,13 +228,13 @@ export default async function pluginContentDocs(
|
|||
const tagsProp: PropTagsListPage['tags'] = Object.values(
|
||||
versionTags,
|
||||
).map((tagValue) => ({
|
||||
name: tagValue.label,
|
||||
label: tagValue.label,
|
||||
permalink: tagValue.permalink,
|
||||
count: tagValue.docIds.length,
|
||||
}));
|
||||
|
||||
// Only create /tags page if there are tags.
|
||||
if (Object.keys(tagsProp).length > 0) {
|
||||
if (tagsProp.length > 0) {
|
||||
const tagsPropPath = await createData(
|
||||
`${docuHash(`tags-list-${version.versionName}-prop`)}.json`,
|
||||
JSON.stringify(tagsProp, null, 2),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue