Skip to content

Commit a7e87e4

Browse files
committed
Added isGithubShareButtonEnabled
1 parent 93114fe commit a7e87e4

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

components/NotionPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export const NotionPage: React.FC<types.PageProps> = ({
282282
footer={footer}
283283
/>
284284

285-
<GitHubShareButton />
285+
{config.isGithubShareButtonEnabled && <GitHubShareButton />}
286286
</DarkModeContext.Provider>
287287
</>
288288
)

lib/config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ export const navigationLinks: Array<NavigationLink | null> = getSiteConfig(
112112
// Optional site search
113113
export const isSearchEnabled: boolean = getSiteConfig('isSearchEnabled', true)
114114

115+
// Optional github share button
116+
export const isGithubShareButtonEnabled: boolean = getSiteConfig('isGithubShareButtonEnabled', true)
117+
115118
// ----------------------------------------------------------------------------
116119

117120
// Optional redis instance for persisting preview images
@@ -163,8 +166,8 @@ export const site: Site = {
163166
export const fathomId = isDev ? null : process.env.NEXT_PUBLIC_FATHOM_ID
164167
export const fathomConfig = fathomId
165168
? {
166-
excludedDomains: ['localhost', 'localhost:3000']
167-
}
169+
excludedDomains: ['localhost', 'localhost:3000']
170+
}
168171
: undefined
169172

170173
export const posthogId = process.env.NEXT_PUBLIC_POSTHOG_ID

lib/site-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface SiteConfig {
2626
isTweetEmbedSupportEnabled?: boolean
2727
isRedisEnabled?: boolean
2828
isSearchEnabled?: boolean
29+
isGithubShareButtonEnabled?: boolean
2930

3031
includeNotionIdInUrls?: boolean
3132
pageUrlOverrides?: types.PageUrlOverridesMap

site.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export default siteConfig({
4242
// this requires support from Notion.
4343
isSearchEnabled: true,
4444

45+
// whether or not to show the GitHub share button on the top-right.
46+
isGithubShareButtonEnabled: true,
47+
4548
// map of notion page IDs to URL paths (optional)
4649
// any pages defined here will override their default URL paths
4750
// example:

0 commit comments

Comments
 (0)