Skip to content

Commit

Permalink
Added in Disqus Comments (maybe?)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeraze committed Nov 19, 2022
1 parent 6c4ae97 commit 5446dcc
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 35 deletions.
20 changes: 17 additions & 3 deletions components/NotionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import { PageAside } from './PageAside'
import { PageHead } from './PageHead'
import styles from './styles.module.css'

import { DiscussionEmbed } from 'disqus-react';


// -----------------------------------------------------------------------------
// dynamic imports for optional components
// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -80,6 +83,7 @@ const Collection = dynamic(() =>
const Equation = dynamic(() =>
import('react-notion-x/build/third-party/equation').then((m) => m.Equation)
)

const Pdf = dynamic(
() => import('react-notion-x/build/third-party/pdf').then((m) => m.Pdf),
{
Expand Down Expand Up @@ -165,7 +169,7 @@ export const NotionPage: React.FC<types.PageProps> = ({
propertyLastEditedTimeValue,
propertyTextValue,
propertyDateValue
}),
}),
[]
)

Expand Down Expand Up @@ -242,6 +246,17 @@ export const NotionPage: React.FC<types.PageProps> = ({
getPageProperty<string>('Description', block, recordMap) ||
config.description

const disqus = <DiscussionEmbed
className='disqusComments'
shortname='yerazesdomain'
config={
{
url: {canonicalPageUrl},
title: {title}
}
}
/>

return (
<>
<PageHead
Expand Down Expand Up @@ -278,10 +293,9 @@ export const NotionPage: React.FC<types.PageProps> = ({
mapImageUrl={mapImageUrl}
searchNotion={config.isSearchEnabled ? searchNotion : null}
pageAside={pageAside}
pageFooter={pageId === site.rootNotionPageId ? null : disqus}
footer={footer}
/>

<GitHubShareButton />
</>
)
}
1 change: 1 addition & 0 deletions components/PageActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const PageActions: React.FC<{ tweet: string }> = ({ tweet }) => {
>
<AiOutlineRetweet />
</a>

</div>
)
}
61 changes: 46 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@vercel/og": "^0.0.19",
"classnames": "^2.3.1",
"date-fns": "^2.28.0",
"disqus-react": "^1.1.5",
"expiry-map": "^2.0.0",
"fathom-client": "^3.4.1",
"got": "^12.0.3",
Expand Down
5 changes: 5 additions & 0 deletions styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ body {
color: var(--fg-color);
caret-color: var(--fg-color);
}


.disqusComments {
width: 100%;
}

0 comments on commit 5446dcc

Please sign in to comment.