From 76a04062a5643bd6ca45538db5baf8196b2043a9 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Tue, 19 Jan 2021 21:01:35 -0500 Subject: [PATCH] chore: moving more config into site.config.js --- components/NotionPage.tsx | 19 ++++++++++--------- lib/config.ts | 10 ++++++++-- site.config.js | 7 ++++++- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/components/NotionPage.tsx b/components/NotionPage.tsx index 8f9ffc5..92c7858 100644 --- a/components/NotionPage.tsx +++ b/components/NotionPage.tsx @@ -97,15 +97,16 @@ export const NotionPage: React.FC = ({ // only display comments on blog post pages if (isBlogPost) { - comments = ( - - ) + if (config.utterancesGitHubRepo) { + comments = ( + + ) + } } return ( diff --git a/lib/config.ts b/lib/config.ts index 528ce84..fd88847 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -41,10 +41,16 @@ export const defaultPageCoverPosition: number = getSiteConfig( 0.5 ) -// image CDN host to proxy all image requests through +// Optional utteranc.es comments via GitHub issue comments +export const utterancesGitHubRepo: string | null = getSiteConfig( + 'utterancesGitHubRepo', + null +) + +// Optional image CDN host to proxy all image requests through export const imageCDNHost: string | null = getSiteConfig('imageCDNHost', null) -// whether or not to enable support for LQIP preview images +// Optional whether or not to enable support for LQIP preview images // (requires a Google Firebase collection) export const isPreviewImageSupportEnabled: boolean = getSiteConfig( 'isPreviewImageSupportEnabled', diff --git a/site.config.js b/site.config.js index 81036f2..21c13d8 100644 --- a/site.config.js +++ b/site.config.js @@ -21,7 +21,7 @@ module.exports = { github: 'transitive-bullshit', linkedin: 'fisch2', - // default notion values for site-wide consistency + // default notion icon and cover images for site-wide consistency // page-specific values will override these site-wide defaults // optional defaultPageIcon: @@ -31,9 +31,14 @@ module.exports = { defaultPageCoverPosition: 0.1862, // image CDN host to proxy all image requests through + // NOTE: this requires you to set up an external image proxy // optional imageCDNHost: 'https://ssfy.io', + // Utteranc.es comments via GitHub issue comments + // optional + utterancesGitHubRepo: 'transitive-bullshit/transitivebullsh.it', + // whether or not to enable support for LQIP preview images // NOTE: this requires you to set up Google Firebase and add the environment // variables specified in .env.example