Skip to content

Commit ca4006c

Browse files
committed
add exclude list via docusaurus.config.js
1 parent 20ac0bd commit ca4006c

File tree

7 files changed

+20
-2
lines changed

7 files changed

+20
-2
lines changed

docs/cloud/changelogs/changelog-25_1-25_4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: 'v25.4 Changelog for Cloud'
44
description: 'Changelog for v25.4'
55
keywords: ['changelog', 'cloud']
66
sidebar_label: 'v25.4'
7+
show_related_blogs: false
78
---
89

910
## Backward Incompatible Changes {#backward-incompatible-changes}

docs/cloud/changelogs/fast-release-24-2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: 'v24.2 Changelog'
44
description: 'Fast release changelog for v24.2'
55
keywords: ['changelog']
66
sidebar_label: 'v24.2'
7+
show_related_blogs: false
78
---
89

910
### ClickHouse release tag: 24.2.2.15987 {#clickhouse-release-tag-242215987}

docs/cloud/reference/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ slug: /whats-new/cloud
33
sidebar_label: 'Cloud Changelog'
44
title: 'Cloud Changelog'
55
description: 'ClickHouse Cloud changelog providing descriptions of what is new in each ClickHouse Cloud release'
6+
show_related_blogs: false
67
---
78

89
import Image from '@theme/IdealImage';

docs/cloud/security/cloud-access-management/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
slug: /cloud/security/cloud-access-management
33
title: 'Cloud Access Management'
44
description: 'Cloud Access Management Table Of Contents'
5+
show_related_blogs: false
56
---
67

78
| Page | Description |

docusaurus.config.en.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ const config = {
369369
]
370370
],
371371
customFields: {
372+
// add general slug paths here for which you don't want RelatedBlogs component to show
373+
relatedBlogsIgnoreList: [
374+
'/docs/sql-reference',
375+
'/docs/engines'
376+
],
372377
blogSidebarLink: "/docs/knowledgebase", // Used for KB article page
373378
galaxyApiEndpoint:
374379
process.env.NEXT_PUBLIC_GALAXY_API_ENDPOINT || "http://localhost:3000",

src/components/RelatedBlogs/styles.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.relatedBlogsContainer {
33
display: flex;
44
flex-direction: column;
5+
padding-top: 32px;
56
}
67

78
/* Container for just the cards (excluding header) */

src/theme/DocItem/Layout/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ function useDocTOC() {
3737
};
3838
}
3939

40-
40+
function isExcludedPath(path, excludedSlugs) {
41+
// Check if any of the excluded components exist in the path
42+
console.log(path)
43+
console.log(excludedSlugs)
44+
return excludedSlugs.some(component => path.includes(component));
45+
}
4146
export default function DocItemLayout({children}) {
4247
const docTOC = useDocTOC();
4348
const {metadata, frontMatter} = useDoc();
@@ -46,6 +51,9 @@ export default function DocItemLayout({children}) {
4651
const location = useLocation();
4752
const context = useDocusaurusContext();
4853

54+
console.log(context)
55+
const excludeRelatedComponents = isExcludedPath(location.pathname, context.siteConfig.customFields.relatedBlogsIgnoreList)
56+
4957
const [showPopup, setShowPopup] = useState(false)
5058
useEffect(() => {
5159

@@ -108,7 +116,7 @@ export default function DocItemLayout({children}) {
108116
<DocItemContent>{children}</DocItemContent>
109117
<DocItemFooter />
110118
</article>
111-
{frontMatter.show_related_blogs === false ? <></> : <RelatedBlogs frontMatter={frontMatter}/>}
119+
{(excludeRelatedComponents === true || frontMatter.show_related_blogs === false) ? <></> : <RelatedBlogs frontMatter={frontMatter}/>}
112120
<DocItemPaginator />
113121
</div>
114122
</div>

0 commit comments

Comments
 (0)