Cloud Function Deployment
Host Twikoo or deploy it yourself to the specified site
| Deployment Method | Recommendation | Description |
|---|---|---|
| Tencent Cloud One-click Deployment | ★☆☆☆☆ | Although convenient, it only supports pay-as-you-go environments — that is to say, for one-click deployed environments, fees will be incurred when free resources are exhausted. And pay-as-you-go environments cannot be switched to yearly/monthly environments. The free quota database read operations are only 500 times/day, which cannot support Twikoo’s operational requirements. |
| Tencent Cloud Manual Deployment | ★★☆☆☆ | Manually deploy to Tencent Cloud CloudBase environment, faster access speed in mainland China. Requires paid purchase of environment to deploy. |
| Tencent Cloud CLI Deployment | ★☆☆☆☆ | Only for developers with Node.js experience. |
| Vercel Deployment | ★★★☆☆ | Suitable for users who want free deployment, slower or even inaccessible access speed in mainland China, binding your own domain name can improve access speed. |
| Railway Deployment | ★★☆☆☆ | Has free quota but not enough to support one month of continuous operation, simple deployment, suitable for global access. |
| Zeabur Deployment | ★☆☆☆☆ | Requires binding Alipay or credit card, simple deployment, suitable for mainland China access, free plan environment may be deleted at any time. |
| Netlify Deployment | ★★★★☆ | Has sufficient free quota, good access speed in mainland China. |
| Hugging Face Deployment | ★★★★☆ | Free, good access speed in mainland China. Allows custom domain names through Cloudflare Tunnels. |
| AWS Lambda Deployment | ★★★☆☆ | The world’s largest cloud platform, suitable for users who already use the full AWS suite. |
| Cloudflare Workers Deployment | ★★☆☆☆ | Deployment requires command line, shorter cold start time, some functional limitations. |
| Private Deployment | ★★☆☆☆ | Suitable for users with servers, need to apply for HTTPS certificate yourself. |
| Private Deployment (Docker) | ★★★☆☆ | Suitable for users with servers, need to apply for HTTPS certificate yourself. |
Frontend Deployment
👆Just introduce the cloud function environment address above
Using in Hexo
Using in Hexo Butterfly theme
Please refer to Butterfly Installation Document (4) Theme Configuration-2 for configuration
Using in Hexo Keep theme
Please refer to hexo-theme-keep/_config.yml for configuration
Using in Hexo Volantis theme
Please refer to hexo-theme-volantis/_config.yml for configuration
Using in Hexo Ayer theme
Please refer to hexo-theme-ayer/_config.yml for configuration
Using in Hexo NexT theme
Versions below NexT 8 are not supported yet, please upgrade to NexT 8 first. Then execute in the Hexo project root directory
# For NexT version >= 8.0.0 && < 8.4.0
npm install hexo-next-twikoo@1.0.0
# For NexT version >= 8.4.0
npm install hexo-next-twikoo@1.0.3
Then add in the configuration
twikoo:
enable: true
visitor: true
envId: xxxxxxxxxxxxxxx # Tencent Cloud environment fill in envId; Vercel environment fill in address (https://xxx.vercel.app)
# region: ap-guangzhou # Environment region, default ap-shanghai, Tencent Cloud environment fill in ap-shanghai or ap-guangzhou; Vercel environment do not fill
Using in Hexo Matery theme
Please refer to hexo-theme-matery/_config.yml for configuration
Using in Hexo Icarus theme
Please refer to Based on Tencent Cloud, equip your Icarus blog with Twikoo comment system by 异次元de机智君💯
Using in Hexo MengD theme
Please refer to hexo-theme-MengD/_config.yml for configuration
Using in hexo-theme-fluid theme
Please refer to Configuration Guide - Comments for configuration
Using in hexo-theme-cards theme
Please refer to hexo-theme-cards/_config.yml for configuration
Using in maupassant-hexo theme
Please refer to maupassant-hexo/_config.yml for configuration
Using in hexo-theme-redefine theme
Please refer to Redefine Official Documentation #comment for configuration
Using in Hexo-Theme-Solitude theme
Please refer to Solitude Documentation for configuration
Using in Hugo
Using in hugo-theme-stack theme
Please refer to Comments | Stack and hugo-theme-stack/config.yaml#L83 for configuration
Using in FixIt theme
Please refer to Getting Started - FixIt #Theme Configuration and hugo-fixit/FixIt/config.toml#L613-L624 for configuration
Using in VitePress
Please refer to VitePress integrated twikoo reference solution for configuration.
Introduce via CDN
If the blog theme you are using does not support Twikoo, and you don’t know how to introduce Twikoo, you can submit an adaptation request to the blog theme developer
<div id="tcomment"></div>
<script src="https://cdn.jsdelivr.net/npm/twikoo@1.6.44/dist/twikoo.min.js"></script>
<script>
twikoo.init({
envId: 'Your environment id', // Tencent Cloud environment fill in envId; Vercel environment fill in address (https://xxx.vercel.app)
el: '#tcomment', // Container element
// region: 'ap-guangzhou', // Environment region, default ap-shanghai, Tencent Cloud environment fill in ap-shanghai or ap-guangzhou; Vercel environment do not fill
// path: location.pathname, // Custom js path to distinguish different articles, if your article path is not location.pathname, you need to pass this parameter
// lang: 'zh-CN', // Used to manually set the comment area language, list of supported languages https://github.com/twikoojs/twikoo/blob/main/src/client/utils/i18n/index.js
})
</script>
Differences between different versions
twikoo.all.min.js: Full version including Tencent Cloud CloudBase (tcb), if you deploy using Tencent Cloud CloudBase, please choose this versiontwikoo.min.js: Simplified version with Tencent Cloud CloudBase (tcb) removed, smaller size, suitable for all users not deploying with Tencent Cloud CloudBasetwikoo.nocss.js: Styles stripped on the basis of the full version, need to introducetwikoo.cssat the same time to display normally, suitable for users who want to customize comment area styles
Replace CDN mirror
If you encounter slow loading speed of the default CDN, you can replace it with other CDN mirrors. The following are public CDNs to choose from, some of which may take several days to sync the latest version:
Recommended for use in China
https://registry.npmmirror.com/twikoo/1.6.44/files/dist/twikoo.min.jshttps://s4.zstatic.net/npm/twikoo@1.6.44/dist/twikoo.min.js
Recommended for global use
https://cdn.jsdelivr.net/npm/twikoo@1.6.44/dist/twikoo.min.js
Backup options
https://s4.zstatic.net/ajax/libs/twikoo/1.6.41/twikoo.min.jshttps://lib.baomitu.com/twikoo/1.6.39/twikoo.min.js
It is recommended that users who introduce Twikoo via CDN lock the version in the link address to avoid being affected by incompatible updates when Twikoo upgrades in the future.
It is recommended that users who introduce Twikoo via CDN add SRI in the code to ensure integrity, example:
<script
src="https://cdn.jsdelivr.net/npm/twikoo@1.6.36/dist/twikoo.all.min.js"
integrity="sha384-4KfOjEinLSkv1i1J8TzlkC/RTnuiLoR1OLerVgjEKoH5djYtbf7mzEFsz9p3nfuA"
crossorigin="anonymous">
</script>
Where the value of integrity can be queried at SRI Hash Generator.