Can I display a comment count on blog index pages?

USJDpDFw 6y, 133d ago [edited]

I would like to embed Remarkbox on my blog posts, and show the number of comments on the parent index page. Is this supported?

hide preview

What's next? verify your email address for reply notifications!

russell 6y, 133d ago

Yes, we give you access to this data.

For example, the stats for my personal blog:

https://my.remarkbox.com/ns/russell.ballestrini.net/stats.json

At some point I might setup an easy JavaScript snippet that may be embedded in the summary pages.

remark link
hide preview

What's next? verify your email address for reply notifications!

Jeremiah 6y, 103d ago

For a Hugo site, this could be pulled at build time using getJson right? But it would have to pattern match the URL with the post URL and then pull the relevant value. To happen on pageload, you'd have to make it a javascript snippet right?

hide preview

What's next? verify your email address for reply notifications!

russell 6y, 103d ago [edited]

It could be pulled at build time. This might make sense if you build the Hugo site often enough, like daily, otherwise the counts will drift and appear stale.

I can alter the stats.json schema to provide additional fields if needed in your implementation. I don't use Hugo myself so if you want to work on this I'll help for sure!

hide preview

What's next? verify your email address for reply notifications!