Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,6 @@ Object {
},
\\"sidebar\\": \\"community\\"
}",
"tags-list-1-0-0-prop-483.json": "[]",
"tags-list-current-prop-15a.json": "[]",
"version-1-0-0-metadata-prop-608.json": "{
\\"pluginId\\": \\"community\\",
\\"version\\": \\"1.0.0\\",
Expand Down Expand Up @@ -1102,22 +1100,6 @@ Object {

exports[`versioned website (community) content: route config 1`] = `
Array [
Object {
"component": "@theme/DocTagsListPage",
"exact": true,
"modules": Object {
"tags": "~docs/tags-list-current-prop-15a.json",
},
"path": "/community/next/tags",
},
Object {
"component": "@theme/DocTagsListPage",
"exact": true,
"modules": Object {
"tags": "~docs/tags-list-1-0-0-prop-483.json",
},
"path": "/community/tags",
},
Object {
"component": "@theme/DocPage",
"exact": false,
Expand Down Expand Up @@ -1654,8 +1636,6 @@ Object {
],
\\"allTagsPath\\": \\"/docs/next/tags\\"
}",
"tags-list-1-0-0-prop-483.json": "[]",
"tags-list-1-0-1-prop-c39.json": "[]",
"tags-list-current-prop-15a.json": "[
{
\\"name\\": \\"barTag 1\\",
Expand All @@ -1673,7 +1653,6 @@ Object {
\\"count\\": 1
}
]",
"tags-list-with-slugs-prop-1ca.json": "[]",
"version-1-0-0-metadata-prop-608.json": "{
\\"pluginId\\": \\"default\\",
\\"version\\": \\"1.0.0\\",
Expand Down Expand Up @@ -1970,14 +1949,6 @@ Object {

exports[`versioned website content: route config 1`] = `
Array [
Object {
"component": "@theme/DocTagsListPage",
"exact": true,
"modules": Object {
"tags": "~docs/tags-list-1-0-0-prop-483.json",
},
"path": "/docs/1.0.0/tags",
},
Object {
"component": "@theme/DocTagsListPage",
"exact": true,
Expand Down Expand Up @@ -2010,22 +1981,6 @@ Array [
},
"path": "/docs/next/tags/barTag-3-permalink",
},
Object {
"component": "@theme/DocTagsListPage",
"exact": true,
"modules": Object {
"tags": "~docs/tags-list-1-0-1-prop-c39.json",
},
"path": "/docs/tags",
},
Object {
"component": "@theme/DocTagsListPage",
"exact": true,
"modules": Object {
"tags": "~docs/tags-list-with-slugs-prop-1ca.json",
},
"path": "/docs/withSlugs/tags",
},
Object {
"component": "@theme/DocPage",
"exact": false,
Expand Down
28 changes: 16 additions & 12 deletions packages/docusaurus-plugin-content-docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,22 @@ export default function pluginContentDocs(
permalink: tagValue.permalink,
count: tagValue.docIds.length,
}));
const tagsPropPath = await createData(
`${docuHash(`tags-list-${loadedVersion.versionName}-prop`)}.json`,
JSON.stringify(tagsProp, null, 2),
);
addRoute({
path: loadedVersion.tagsPath,
exact: true,
component: options.docTagsListComponent,
modules: {
tags: aliasedSource(tagsPropPath),
},
});

// Only create /tags page if there are tags.
if (Object.keys(tagsProp).length > 0) {
const tagsPropPath = await createData(
`${docuHash(`tags-list-${loadedVersion.versionName}-prop`)}.json`,
JSON.stringify(tagsProp, null, 2),
);
addRoute({
path: loadedVersion.tagsPath,
exact: true,
component: options.docTagsListComponent,
modules: {
tags: aliasedSource(tagsPropPath),
},
});
}
}

async function createTagDocListPage(tag: VersionTag) {
Expand Down