{"id":18023989,"url":"https://github.com/lete114/hexo-artitalk-static","last_synced_at":"2025-03-27T00:30:47.127Z","repository":{"id":71111082,"uuid":"604620298","full_name":"Lete114/hexo-artitalk-static","owner":"Lete114","description":"Artitalk 静态版，本地编写说说(就像写文章一样)，需要 hexo g 生成","archived":false,"fork":false,"pushed_at":"2024-05-06T08:27:41.000Z","size":25,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T03:33:07.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"EJS","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/Lete114.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}},"created_at":"2023-02-21T12:55:17.000Z","updated_at":"2024-12-10T12:27:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b45e4fa-959c-4e53-b556-aec403fa636b","html_url":"https://github.com/Lete114/hexo-artitalk-static","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"36afb7306a58ae4b61ce335ee266b7fe616d7958"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fhexo-artitalk-static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fhexo-artitalk-static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fhexo-artitalk-static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fhexo-artitalk-static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lete114","download_url":"https://codeload.github.com/Lete114/hexo-artitalk-static/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245760561,"owners_count":20667886,"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":[],"created_at":"2024-10-30T07:11:37.256Z","updated_at":"2025-03-27T00:30:46.804Z","avatar_url":"https://github.com/Lete114.png","language":"EJS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hexo-Artitalk-Static\n\nArtitalk 静态版，本地编写说说(就像写文章一样)，需要 `hexo g` 生成 ~~(不会有人天天发说说吧？)~~\n\n## Installation\n\n```bash\nnpm install hexo-artitalk-static\n```\n\n## Usage\n\n在你的博客根目录的 `source/_data` 创建文件 `artitalk.yml`。 以后你的所有说说都会写在这里面\n\n```yml\n## 说说格式\n- content: Hexo-Artitalk-Static 真不错，没有后端，没有请求，速度是真的快\n- content: |\n    如果你的 JavaScript 基础还不错\n    你还可以为 Hexo-Artitalk-Static 写自定义插件，还可以自定义说说的模板\n    自由度是真的高(也可以安装别人的插件)\n```\n\n\u003e 以上方式不会自动实时生成说说的时间，只有在执行了 `hexo s` 或 `hexo g` 的时候才会自动生成说说的时间 (而且是当前执行这个命令的时间，并不是你写说说的时间)\n\n你可以在写说说前执行 `hexo s` 命令，然后再打开 `source/_data/artitalk.yml` 编写新说说，这样它才会实时生成说说的时间\n\n## Configuration\n\n配置信息\n\n```yaml\nartitalk:\n  enable: true\n  title: Artitalk ## 标题\n  path: artitalk/index.html ## 生成路径\n  pageSize: 5 ## 显示几条说说\n  avatar: ## 说说头像\n  plugins: [] ## 插件，具体请看下文\n  template: ## 说说模板，可查看仓库中的 main.ejs\n  imports: ## 在说说模板的开头和结尾处插入内容\n    before:\n      -\n    after:\n      -\n    # - \u003clink rel=\"stylesheet\" href=\"/css/index.css\"\u003e\n    # - '\u003cstyle\u003ebody{color: red}\u003c/style\u003e' ## 注意由于css的‘{}’是关键符号所以需要(单/双)引号''\n    # - \u003cscript\u003ealert(1)\u003c/script\u003e\n```\n\n### Plugins\n\n是一个数组，可以传入多个 js 文件路径，建议是绝对路径，如果是相对路径的话，那么它因该是相对于 hexo 的根目录\n\n举例：自定义插件使得 Hexo-Artitalk-Static 支持 markdown 语法\n\n在 hexo 根目录创建 `artitalk_plugins/markdown.js`，并安装解析 markdown 的第三方库，这里以 [marked](https://marked.js.org/) 作为演示 `npm i marked`\n\n```js\n// artitalk_plugins/markdown.js\nconst marked = require('marked')\n\n/**\n * @param {{content:string,timestamp:number}[]} atData\n */\nmodule.exports = (atData) =\u003e {\n  for (const item of atData) {\n    // 关于 marked 的可选参数以及代码高亮可以查看官网: https://marked.js.org/using_advanced#highlight\n    // 或自己上网搜索解决\n    item.content = marked(item.content)\n  }\n}\n```\n\n然后再 hexo 的配置文件中的 artitlk.plugins 数组中加上路径(一下配置只是演示，其它配置信息已省略)\n\n```yaml\nartitalk:\n  enable: true\n  plugins: ['artitalk_plugins/markdown.js']\n```\n\n当你自己写完一个插件后，你也可以分享给其它人使用，例如发布一个 npm 包让别人安装\n\n包名建议命名为 `hexo-artitalk-static-xxx` (如上 markdown 插件 `hexo-artitalk-static-markdown`)\n\n当别人安装你的插件后 `npm install hexo-artitalk-static-markdown` 在 artitlk.plugins 填写路径\n\n```yaml\nartitalk:\n  enable: true\n  plugins: ['node_modules/hexo-artitalk-static-markdown']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fhexo-artitalk-static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flete114%2Fhexo-artitalk-static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fhexo-artitalk-static/lists"}