Twikoo 部署教程
前言
Twikoo 是一个简洁、安全、免费的静态网站评论系统,基于腾讯云开发。下面是 Twikoo 的部署教程,你可以根据自己的需求选择合适的部署方式。
一、腾讯云手动部署
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
exports.main = require('twikoo-func').main
{ "dependencies": { "twikoo-func": "1.6.42" } }
|
二、腾讯云命令行部署
1 2 3 4 5 6 7 8 9 10 11 12 13
|
git clone https://github.com/twikoojs/twikoo.git cd twikoo
npm install -g yarn yarn install
yarn deploy
|
三、Vercel 部署
四、宝塔面板部署
五、Railway 部署
六、Zeabur 部署
七、Netlify 部署
八、Hugging Face 部署
1 2 3 4 5 6 7 8 9
|
FROM imaegoo/twikoo ENV TWIKOO_PORT 7860 EXPOSE 7860
|
九、私有部署
1 2 3 4 5 6 7 8
|
npm i -g tkserver
tkserver
|
Twikoo 的基本配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <!DOCTYPE html> <html> <head> <title>Twikoo 示例</title> <script src="https://cdn.jsdelivr.net/npm/twikoo@1.6.0/dist/twikoo.min.js"></script> </head> <body> <div id="tcomment"></div> <script> twikoo.init({ envId: '你的环境ID', el: '#tcomment' }); </script> #引入 Twikoo 的 JavaScript 文件。 </body> </html>
|
twikoo评论区图片优化代码
在…/css/xxx.css文件中添加以下代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| .twikoo .el-input__inner, .twikoo .el-textarea__inner { transition: background-position-y 0.3s ease-in-out !important; background-repeat: no-repeat; }
.twikoo .el-input__inner:focus, .twikoo .el-textarea__inner:focus { background-position-y: 100% !important; }
.tk-input .el-textarea__inner { background-size: contain; background-position: right bottom; }
|
然后在主题文件中引用该CSS文件。