Skip to content

Commit

Permalink
Merge pull request #1 from Yeraze/add_disqus
Browse files Browse the repository at this point in the history
Add disqus
  • Loading branch information
Yeraze authored Nov 19, 2022
2 parents 9ea1b3c + 5446dcc commit 0cbf6b9
Show file tree
Hide file tree
Showing 7 changed files with 14,812 additions and 3,581 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>
)
}
Loading

0 comments on commit 0cbf6b9

Please sign in to comment.