How to get remark42 commenting to work with Grav

I have built remark42 commenting system. And am now trying to link it into the pages. code used is:

<script>  var remark_config = {    host: 'REMARK_URL',    site_id: 'YOUR_SITE_ID',  }</script>
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document);</script>

~I have added these to a js file that is loading. The issue is where to add.

<div id="remark42"></div>

so I can call the commenting system into grav. Any ideas on how to achieve the last part?

Hi @Da_bfg , can you send some html output example of you what you to achieve?

@Da_bfg

Assuming you’re using the default Quark theme, have you tried adding that div tag in the templates/partials/blog-item.html.twig ?