mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-25 14:29:36 +01:00
added the option to link older site comments
This commit is contained in:
parent
35c0956f9b
commit
c752310aa0
@ -9,6 +9,7 @@ tags:
|
||||
- "Development"
|
||||
- "slsw"
|
||||
description: "The last day of my journey with Scala is said to be a challenge"
|
||||
disqusId: "24"
|
||||
---
|
||||
|
||||
The book doesn't offer a day 4, my school, however, does. Or rather, it wants us to "create" a day 4. The main objective of day 4 is to "create a [smart](https://en.wikipedia.org/wiki/SMART_criteria) goal which fits the language and challenges you". For this purpose I came up with the following goal:
|
||||
|
@ -7,9 +7,10 @@ import { useSiteMetadata } from "@/hooks";
|
||||
interface Props {
|
||||
postTitle: string;
|
||||
postSlug: string;
|
||||
disqusId?: string;
|
||||
}
|
||||
|
||||
const Comments: React.FC<Props> = ({ postTitle, postSlug }: Props) => {
|
||||
const Comments: React.FC<Props> = ({ postTitle, postSlug, disqusId }: Props) => {
|
||||
const { url, disqusShortname } = useSiteMetadata();
|
||||
|
||||
if (!disqusShortname) {
|
||||
@ -21,7 +22,7 @@ const Comments: React.FC<Props> = ({ postTitle, postSlug }: Props) => {
|
||||
shortname={disqusShortname}
|
||||
config={{
|
||||
url: url + postSlug,
|
||||
identifier: postTitle,
|
||||
identifier: disqusId ?? postTitle,
|
||||
title: postTitle,
|
||||
}}
|
||||
/>
|
||||
|
@ -14,7 +14,7 @@ interface Props {
|
||||
const Post: React.FC<Props> = ({ post }: Props) => {
|
||||
const { html } = post;
|
||||
const { tagSlugs, slug } = post.fields;
|
||||
const { tags, title, date } = post.frontmatter;
|
||||
const { tags, title, date, disqusId } = post.frontmatter;
|
||||
|
||||
return (
|
||||
<div className={styles.post}>
|
||||
@ -29,7 +29,7 @@ const Post: React.FC<Props> = ({ post }: Props) => {
|
||||
</div>
|
||||
|
||||
<div className={`${styles.comments} hideInPrintView`}>
|
||||
<Comments postSlug={slug} postTitle={post.frontmatter.title} />
|
||||
<Comments disqusId={disqusId} postSlug={slug} postTitle={post.frontmatter.title} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -45,6 +45,7 @@ export const query = graphql`
|
||||
tags
|
||||
title
|
||||
socialImage
|
||||
disqusId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ interface Frontmatter {
|
||||
description?: string;
|
||||
tags?: Array<string>;
|
||||
socialImage?: string;
|
||||
disqusId?: string;
|
||||
}
|
||||
|
||||
export default Frontmatter;
|
||||
|
Loading…
Reference in New Issue
Block a user