Closed pablovgdev closed 4 years ago
Hi. Thanks for the detailed explanation.
I'm not sure how best to insert Disqus comments into the Chronoblog, I think there are several options. It is necessary to experiment/try various options, after which I will answer here and, possibly, update the documentation.
Okey thanks :D
ok, so far, only such an idea comes to my mind, just use the usual web api, like:
location.href
location.pathname
but I'm not sure if this is the best solution =/
So, now through props in post-footer.mdx you can get information about the site metadata and the post.
Here is an example of how this applies to Disqus:
import { Disqus } from 'gatsby-plugin-disqus';
<AuthorBanner></AuthorBanner>
<p> </p>
<Disqus
config={{
url: props.siteMetadata.siteUrl + props.postData.fields.slug,
title: props.postData.frontmatter.title,
id: props.postData.id
}}
/>
But in general, this way you can refer from post-footer.mdx to any information about the post.
This can only be done in the latest version of Chronoblog (v0.18.0)
I also created an example of how to use Chronoblog and Disqus: https://github.com/Chronoblog/gatsby-starter-chronoblog-disqus
I'm using Disqus to add comments on my blog posts, but I need a unique identifier that allows me to know to which post a comment belongs.
A simple way to achieve this is to use the post's title, but I'd have to add a PostComments component to each blog post with its title.
What I'd like to do is to use some kind of variable referencing the post's title inside the post footer like this:
I want that post.title variable to be a reference on the current post title.
Is there a simple way to achieve this?