#Note/Hub #Note/HowTo #Obsidian/Publish/Comment
I utilize [Obsidian Publish](https://help.obsidian.md/Obsidian+Publish/Introduction+to+Obsidian+Publish) to share my digital garden. One primary goal is to foster engagement and discussions with like-minded individuals, thereby gaining fresh insights and feedback. Ideally, I'd want a dedicated comment section for each note, equipped with spam detection.
However, Obsidian Publish lacks native comment support. My search on the Obsidian forum didn't yield a ready-made solution, but a [comment by _jacklaing_](https://forum.obsidian.md/t/comment-section-on-obsidian-publish/11252/7?u=sparrow98) intrigued me:
![[Pasted image 20231031224448.png]]
_jacklaing_ embeds a comment plugin on his Ghost-published pages using an [iframe](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe), managed by a third-party service called Discourse. This approach, while offering limited control, seemed efficient for someone like me, who's just starting with front-end development. This led me to two pivotal questions:
1. Which third-party comment service aligns with my needs?
2. How can I embed an iframe into **each note I publish**?
For the first question, ChatGPT introduced me to [Disqus](https://disqus.com/), a seasoned service I had previously encountered. It became my go-to choice, and it hasn't disappointed.
Addressing the second question, I stumbled upon Obsidian Publish's [Customize your site](https://help.obsidian.md/Obsidian+Publish/Customize+your+site#Static+assets) section. It revealed the potential of the `publish.js` file to execute on note pages. With this, the puzzle seemed solvable:
```mermaid
flowchart TD
subgraph CommentModule[JavaScript Comment Module]
B[Create comment section on note's webpage]
D[Embed Disqus comment plugin]
B-->D
end
subgraph publishJS[Manage publish.js]
H[Edit publish.js]
I[Append comment module]
J[Save to Vault's root]
H-->I-->J
end
subgraph Deploy[Deploy publish.js]
K[Publish changes in Obsidian]
L[Review publish.js under New]
M[Publish]
K-->L-->M
end
CommentModule --> publishJS --> Deploy
```
![[Integrating Disqus Comments with Obsidian Publish]]
Interestingly, Obsidian natively supports [embedding external resources](https://help.obsidian.md/Editing+and+formatting/Embedding+web+pages) via iframes. A potential solution might involve a template with the comment plugin iframe, which then receives unique note identifiers to spawn distinct comment threads. The manual execution remains a mystery to me. If you've successfully integrated comments into your digital garden, I'd love to hear about it in the comments below!