Comment system for Hexo Blog - Isso

前言

繞了一圈最佳的Blog評論系統就在身邊…改用Isso吧

參考資料

Hexo-theme-Next的comment說明

Isso QuickStart

作法

Docker-compose.yml內容

更新於2022/7/26

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
services:
isso:
image: ghcr.io/isso-comments/isso:latest
container_name: isso
environment:
- PUID=1000
volumes:
- /var/lib/docker/volumes/isso/config:/config
- /var/lib/docker/volumes/isso/data:/db
restart: unless-stopped
networks:
- traefik
labels:
traefik.enable: true
traefik.http.routers.isso.rule: Host(`$domain_you_like`)
traefik.http.routers.isso.tls: true
traefik.http.routers.isso.tls.certresolver: myresolver

networks:
traefik:
external: true
name: web-service

基本上這種寫法需要先去touch一個isso.conf檔案並且記得權限要讓定義的PUID可以讀

isso.conf內容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[general]
dbpath = /db/$(databasename).db #這個檔名可以自己定義
host = https://$(your_Blog_domain) #這裡記得要設定Blog的網址
[server]
listen = http://0.0.0.0:8080 #這裡設定的Port就是docker-compose.yml裡面要定義的容器內的port
[guard]
enabled = true
ratelimit = 2
direct-reply = 3
reply-to-self = false
require-author = true
require-email = true
[moderation] #這個是需要不需要先審查過再貼出,要的就改成true
enabled = false
purge-after = 30d
[admin] #這是設定要不要管理員
enabled = false
password = strong-password

外部轉出

跑起來後用nginx-proxy-manager去弄個外部的連接位置然後就可以去設定Next了

有強大的Traefik…什麼都不用擔心…

Next設定

在_config.next.yml裡面加上

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# ---------------------------------------------------------------
# Comments Settings
# See: https://theme-next.js.org/docs/third-party-services/comments
# ---------------------------------------------------------------

# Multiple Comment System Support
comments:
# Available values: tabs | buttons
style: tabs
# Choose a comment system to be displayed by default.
# Available values: disqus | disqusjs | changyan | livere | gitalk | utterances
active: isso
# Setting `true` means remembering the comment system selected by the visitor.
storage: true
# Lazyload all comment systems.
lazyload: false
# Modify texts or order for any naves, here are some examples.
nav:
#disqus:
# text: Load Disqus
# order: -1
#gitalk:
# order: -2
.....
.....
# Isso
# For more information: https://posativ.org/isso/
isso: https://$domain_you_like/

然後hexo d -g就好了

注意事項

  • 我用Traefik跑https的話data-isso就用https://$domain_you_like/來取代教學裡面的//$domain_you_like/

  • hexo s在本機跑的時候是看不到評論的…一定要hexo g -d拋到github上面才看得到…