{"id":19039853,"url":"https://github.com/johnlui/laraduoshuo","last_synced_at":"2025-04-23T20:50:57.337Z","repository":{"id":77521855,"uuid":"91261274","full_name":"johnlui/LaraDuoshuo","owner":"johnlui","description":"Laravel 5 实现的私有评论系统，用于 Hexo、Jekyll 等静态博客系统","archived":false,"fork":false,"pushed_at":"2017-06-07T02:09:58.000Z","size":8161,"stargazers_count":93,"open_issues_count":4,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-18T05:53:54.310Z","etag":null,"topics":["colt","hexo","jekyll","jiandan"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnlui.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-14T17:51:09.000Z","updated_at":"2024-11-04T02:47:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"3eb49432-bf01-44e4-86a3-c05e23f5744b","html_url":"https://github.com/johnlui/LaraDuoshuo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlui%2FLaraDuoshuo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlui%2FLaraDuoshuo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlui%2FLaraDuoshuo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlui%2FLaraDuoshuo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnlui","download_url":"https://codeload.github.com/johnlui/LaraDuoshuo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514733,"owners_count":21443208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colt","hexo","jekyll","jiandan"],"created_at":"2024-11-08T22:19:05.159Z","updated_at":"2025-04-23T20:50:57.330Z","avatar_url":"https://github.com/johnlui.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"LaraDuoshuo\n----\n\n多说将于 2017 年 6 月 1 号关闭，此为我即兴写的私有评论系统，初步设计用于 Hexo，下一步准备支持煎蛋那样的单页面多评论需求。\n\n## live demo\n\n[https://autolayout.club](https://autolayout.club/)\n\n## 特性\n\n- [ ] 多说数据导入功能\n- [ ] 新评论邮件通知，被回复邮件通知\n- [x] 基于简单 @ 的回复功能\n- [x] “审核后才显示”开关\n- [x] 域名白名单\n- [x] 基于 Akismet 的反垃圾评论\n- [x] 管理后台：评论审核、编辑\n- [x] 页面自注册\n- [x] 跨域部署，异步加载\n- [x] 移动兼容\n\n## 环境要求\n\n\u003e ### PHP \u003e 5.6.4\n\n## 图片们\n\n### 原理图\n\n![原理图](https://raw.githubusercontent.com/johnlui/LaraDuoshuo/master/public/pic1.jpg)\n\n### 截图\n\n![截图](https://raw.githubusercontent.com/johnlui/LaraDuoshuo/master/public/pic2.jpg)\n\n## 如何激活附带的 demo\n\n### 后端跑起来\n\n生成 .env 文件和密钥：\n\n```bash\ngit clone git@github.com:johnlui/LaraDuoshuo.git\ncd LaraDuoshuo\ncomposer update\nsudo chmod -R 777 storage/ bootstrap/cache/\ncp .env.example .env\nphp artisan key:generate\ncd public\nphp -S 0.0.0.0:9000\n```\n\n然后将数据库配置修改为真实值，并将根目录下的 LaraDuoshuo.sql 导入数据库。\n\n### demo 跑起来\n\n```bash\nnpm install hexo-cli -g\ncd hexo-demo\nhexo serve\n```\n\n## 如何用于 Hexo\n\n### 后端\n\n将代码部署到自己的服务器，指一个域名过去即可。\n\n### 前端\n\n#### Hexo 默认主题\n\n在 `themes/landscape/layout/_partial/article.ejs` 第 36 行 `\u003c/article\u003e` 的后面添加如下代码：\n\n```ejs\n\u003c% if (!index) { -%\u003e\n\u003clink rel=\"stylesheet\" href=\"//fuck.io:9000/css/static.css\"\u003e\n\u003cdiv id=\"comments\"\u003e\u003c/div\u003e\n\u003c% } -%\u003e\n```\n\n将 `themes/landscape/layout/_partial/after-footer.ejs` 第 17 行 `\u003cscript src=\"//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js\"\u003e\u003c/script\u003e` 替换为：\n\n```ejs\n\u003cscript src=\"//apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"//fuck.io:9000/js/static.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nLaraDuoshuo.APP_KEY = 'base64:nMYxR20sgL9zbiRrMS8GekiVzPSLBId9QAoTepx+nuk=';\nLaraDuoshuo.BaseURL = 'http://fuck.io:9000';\n\u003c/script\u003e\n```\n\n请将上面的 `LaraDuoshuo.APP_KEY` 的值替换为你服务端 .env 中的 APP_KEY 的值。\n\n#### 著名的 NexT 主题\n\n在 `themes/next/layout/_layout.swig` 中 `{% if page.comments %}` 这一行的下面增加：\n\n```swig\n\u003clink rel=\"stylesheet\" href=\"//fuck.io:9000/css/static.css\"\u003e\n\u003cdiv id=\"comments\"\u003e\u003c/div\u003e\n```\n\n在 `\u003cscript type=\"text/javascript\" src=\"//cdn.bootcss.com/jquery/2.1.3/jquery.min.js\"\u003e\u003c/script\u003e` 这一行的下面增加：\n\n```swig\n\u003cscript src=\"//fuck.io:9000/js/static.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nLaraDuoshuo.APP_KEY = 'base64:nMYxR20sgL9zbiRrMS8GekiVzPSLBId9QAoTepx+nuk=';\nLaraDuoshuo.BaseURL = 'http://fuck.io:9000';\n\u003c/script\u003e\n```\n\n同样，请将上面的 `LaraDuoshuo.APP_KEY` 的值替换为你服务端 .env 中的 APP_KEY 的值。\n\n#### 替换域名\n\n别忘了将上文中的 `fuck.io:9000` 替换为你真实的域名端口。\n\n\n## 如何用于自己的静态页面\n\n代码如下：\n\n```php\n\u003clink rel=\"stylesheet\" href=\"//fuck.io:9000/css/static.css\"\u003e // 默认样式\n\u003cdiv id=\"comments\"\u003e\u003c/div\u003e // 评论 DOM 锚点\n\n\u003cscript src=\"//apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"//fuck.io:9000/js/static.js\"\u003e\u003c/script\u003e // 此 js 必须在 jQuery 之后引入，否则会被覆盖\n\u003cscript\u003e // 注入基础参数\nLaraDuoshuo.APP_KEY = 'base64:nMYxR20sgL9zbiRrMS8GekiVzPSLBId9QAoTepx+nuk=';\nLaraDuoshuo.BaseURL = 'http://fuck.io:9000';\n\u003c/script\u003e\n```\n\n## 其他配置\n\n### 域名白名单\n\n修改 `config/app.php` 内的 `domain_white_list` 字段，将允许使用本系统的域名加入进去即可。注意那里还有一个开关，默认是不验证的呦。\n\n### Akismet 反垃圾评论\n\n到 https://akismet.com 注册一个账户，得到一个“AKISMET API KEY”，配置到 `config/app.php` 内的 `AKISMET_API_KEY` 字段，就 OK 啦！\n\n### 管理后台\n\n访问 `/register` 注册一个账号，成功之后将 `config/app.php` 内的 `register_enable` 字段改为 `false` 关闭注册。\n\n之后就可以使用简洁高效的管理后台啦~\n\n### 审核通过才显示\n\n此配置位于 `config/app.php` 内，名为 `force_show_after_check`，默认为打开状态。\n\n## 开源协议\n\n本项目遵循 MIT 协议开源，具体请查看根目录下的 LICENSE 文件。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnlui%2Flaraduoshuo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnlui%2Flaraduoshuo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnlui%2Flaraduoshuo/lists"}