comments
1.0.0
即時評論引擎,支援匿名或經過身份驗證的帖子
mkdir -p target/standalone && cd target/standalone
wget https://cdn.jsdelivr.net/npm/[email protected]/bin/comments-linux-standalone-x64.tar.gz
tar -xzf comments-linux-standalone-x64.tar.gz
./start.sh
該演示在位於 SG 的 2.5 美元 vultr 計劃上運行,該應用程式配置為使用最大記憶體 128mb(將大部分可用記憶體留給檔案系統快取)。
將其放在 html 正文中的任何位置(儘管建議將其放在最後)
< div id =" comments " > </ div >
< script >
window . comments_config = {
collapse_depth : 7 , // the depth where comments get collapsed by default
limit_depth : 10 , // max: 127
//auth_host: 'https://api.dyuproject.com', // if you prefer authenticated comments
ws_enabled : true , // real-time updates
ws_host : 'wss://rpc.dyuproject.com/sub' ,
rpc_host : 'https://rpc.dyuproject.com'
}
</ script >
< script src =" https://netlify-comments.dyuproject.com/dist/build.js " > </ script >
< link rel =" stylesheet " href =" https://netlify-comments.dyuproject.com/dist/build.css " />
注意:使用相同的實例為演示提供支援。沒有任何跟踪。
mkdir -p target/data/main
echo " Your data lives in user/ dir. Feel free to back it up. " > target/data/main/README.txt
# download protostuffdb
yarn add [email protected] && mv node_modules/protostuffdb/dist/ * target/ && rm -f package.json yarn.lock && rm -r node_modules
wget -O target/fbsgen-ds.jar https://repo1.maven.org/maven2/com/dyuproject/fbsgen/ds/fbsgen-ds-fatjar/1.0.10/fbsgen-ds-fatjar-1.0.10.jar
./modules/codegen.sh
mvn install
npm install -g http-server clean-css-cli
cd comments-ts
yarn install
# produces a single jar the first time (comments-all/target/comments-all-jarjar.jar)
./run.sh
# on another terminal
cd comments-ts
# serves the ui via http://localhost:8080/
yarn run dev
如果您的開發機器是 MacOS, protostuffdb目前沒有適用於它的二進位發行版(沒有可供測試/建置的 MacOS 機器)。
另一方面,您仍然可以使用此臨時解決方法在客戶端部分進行開發:
comments-ts/index.html
window.rpc_host = 'http://127.0.0.1:5020'
替換為window.rpc_host = 'https://rpc.dyuproject.com'
cd comments-ts
# produces a single js and other assets in comments-ts/dist/
yarn run build