IkeqIkeq

The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts.

Inside Theme — Comments

Jun 21, 2019

Inside has native support for Disqus and LiveRe. You can also integrate any other comment system via the plugin injection system.

Disqus

Step 1: Create a Disqus site

Sign up at disqus.com and create a new site. You’ll get a shortname (e.g. yourblog).

Step 2: Configure Inside

1
2
3
comments:
disqus:
shortname: yourblog

That’s all. Inside loads the Disqus embed script automatically on posts and pages that have comments: true in their front-matter.

Advanced: Custom script URL

If you need to use a specific Disqus embed configuration:

1
2
3
4
5
6
7
comments:
disqus:
# Use a specific embed script URL instead of the auto-generated one
script: //yourblog.disqus.com/embed.js
# Autoload comments when the page scrolls into view (default: true)
# Set to false to show a "Load Comments" button instead
autoload: true

LiveRe (来必力)

LiveRe is a comment platform popular in China, with good integration for Chinese social logins (Weibo, WeChat, QQ).

Step 1: Create a LiveRe account

Sign up at livere.com and install the “City” (免费) plan. You’ll get a uid.

Step 2: Configure Inside

1
2
3
comments:
livere:
uid: YOUR_UID

Inside loads the LiveRe embed code automatically.


Custom Comment System

For any comment system not natively supported (e.g., Giscus, utterances, Remark42, Cusdis), use Inside’s plugin injection to insert the comment widget HTML.

Example: Giscus (GitHub Discussions-based)

First enable the Giscus app on your GitHub repo at giscus.app. You’ll get a repo, category, and mapping settings.

Then inject it via the comments injection point:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
plugins:
- position: comments
template: |
<script
src="https://giscus.app/client.js"
data-repo="your/github-repo"
data-repo-id="your-repo-id"
data-category="Announcements"
data-category-id="DIC_kwDxxx"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="en"
crossorigin="anonymous"
async>
</script>

The position: comments injects this HTML at the bottom of every post/page, replacing the built-in comment placeholder.

Example: Disqus in lazy-load mode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
plugins:
- position: comments
template: |
<div id="disqus_thread"></div>
<script>
var disqus_config = function() {
this.page.url = '{{ page.permalink }}';
this.page.identifier = '{{ page.id }}';
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://yourblog.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view comments.</noscript>

Per-Page Comment Control

Comments are enabled by default on all posts and pages. To disable for a specific item:

1
2
3
---
comments: false
---

Or globally disable:

1
2
comments:
enabled: false

(where enabled is a top-level key that Inside checks before loading any comment provider).


Comment Loading Behavior

By default, Inside loads comments lazily — the comment widget only initializes when the user scrolls to the bottom of the article. This keeps initial page loads fast.

You can force immediate loading by setting autoload: true in the respective provider config.


Next Steps

Buy me a cup of milk 🥛.