{"id":19069563,"url":"https://github.com/srect/srect.github.io","last_synced_at":"2025-08-23T15:43:11.210Z","repository":{"id":43178677,"uuid":"468692361","full_name":"sRect/sRect.github.io","owner":"sRect","description":"hexo blog","archived":false,"fork":false,"pushed_at":"2023-09-27T09:40:35.000Z","size":21887,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T03:42:00.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sRect.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":"2022-03-11T09:46:31.000Z","updated_at":"2023-05-23T08:07:00.000Z","dependencies_parsed_at":"2025-01-02T15:43:21.471Z","dependency_job_id":null,"html_url":"https://github.com/sRect/sRect.github.io","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sRect/sRect.github.io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sRect%2FsRect.github.io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sRect%2FsRect.github.io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sRect%2FsRect.github.io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sRect%2FsRect.github.io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sRect","download_url":"https://codeload.github.com/sRect/sRect.github.io/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sRect%2FsRect.github.io/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271755065,"owners_count":24815334,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-09T01:14:46.516Z","updated_at":"2025-08-23T15:43:11.181Z","avatar_url":"https://github.com/sRect.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hexo 快速上手\n\n\u003e Hexo 是一个快速、简洁且高效的博客框架。可以使用 Markdown 写文章，方便高效。\n\n## 1. 安装\n\n```bash\nnpm install -g hexo-cli\n```\n\n## 2. 初始化\n\n```bash\nhexo init \u003cproject-name\u003e\ncd \u003cproject-name\u003e\nnpm install\n```\n\n## 3. 主要 api\n\n1. 创建新文章\n\n```bash\nhexo new \u003ctitle\u003e\n```\n\n- 在`source/_posts/`下新建\n\n例如创建 foo 页，在`source/_posts/`目录下就会多出一个`foo.md`文件，就在那里面写文章\n\n```bash\nhexo new foo\n```\n\n- 在`source`下新建其它的目录\n\n例如在`source/about/`下创建`bar.md`文件\n\n```bash\nhexo new page --path about/bar \"bar\"\n```\n\n2. 生成静态文件\n\n项目根目录会多出一个`public`文件夹，就是编译过后的`html`静态文件\n\n```bash\nhexo generate\n```\n\n3. 清除缓存\n\n把上面生成的`public`文件夹删掉\n\n```bash\nhexo clean\n```\n\n4. 启动服务\n\n默认情况下，`http://localhost:4000`访问\n\n```bash\nhexo server\n```\n\n## 4. 安装心仪的主题\n\n1. [hexo themes](https://hexo.io/themes/)\n\n这么多主题，总有一款适合你\n\n2. 本文选择的主题[`hexo-theme-fluid`](https://github.com/fluid-dev/hexo-theme-fluid)\n\n- 主题安装\n\n```bash\nnpm install --save hexo-theme-fluid\n```\n\n然后在博客目录下创建 \\_config.fluid.yml，将主题的 \\_config.yml 内容复制进去\n\n- 配置主题\n\n修改 Hexo 博客目录中的 \\_config.yml:\n\n```\ntheme: fluid  # 指定主题\n\nlanguage: zh-CN  # 指定语言，会影响主题显示的语言，按需修改\n```\n\n## 5. github pages 部署\n\n1. 本地生成 ssh 密钥对\n\n```bash\nssh-keygen -t rsa -C \"用户名@example.com \"\n```\n\n2. 在仓库`Settings \u003e Deploy Keys`中添加公钥内容，并勾选访问权限，最后确定\n\n3. 在仓库`Settings \u003e Secrets`中添加私钥，key 为`DEPLOY_KEY`，内容为私钥内容\n\n4. 项目`_config.yml`配置文件和主题配置文件配置`deploy`字段\n\n```yml\ndeploy:\n  type: git\n  repo: \u003c你的github仓库 SSH下载链接\u003e\n  branch: gh-pages\n```\n\n5. `.github/workflows/deploy.yml`\n\n```yml\nname: Hexo Github Pages Deploy\n\n# https://github.com/marketplace/actions/hexo-action?version=v1.0.4\n\non: [push]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    name: A job to deploy blog.\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v1\n        with:\n          submodules: true # Checkout private submodules(themes or something else).\n\n      # Caching dependencies to speed up workflows. (GitHub will remove any cache entries that have not been accessed in over 7 days.)\n      - name: Cache node modules\n        uses: actions/cache@v1\n        id: cache\n        with:\n          path: node_modules\n          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}\n          restore-keys: |\n            ${{ runner.os }}-node-\n      - name: Install Dependencies\n        if: steps.cache.outputs.cache-hit != 'true'\n        run: npm ci\n\n      # Deploy hexo blog website.\n      - name: Deploy\n        id: deploy\n        uses: sma11black/hexo-action@v1.0.3\n        with:\n          deploy_key: ${{ secrets.DEPLOY_KEY }}\n          user_name: \u003c你的github用户名\u003e # (or delete this input setting to use bot account)\n          user_email: \u003c你的github邮箱\u003e # (or delete this input setting to use bot account)\n          commit_msg: ${{ github.event.head_commit.message }} # (or delete this input setting to use hexo default settings)\n      # Use the output from the `deploy` step(use for test action)\n      - name: Get the output\n        run: |\n          echo \"${{ steps.deploy.outputs.notify }}\"\n```\n\n## 6. 参考资料\n\n1. [Hexo 官方文档](https://hexo.io/zh-cn/docs)\n2. [Hexo Fluid 主题用户手册](https://hexo.fluid-dev.com/docs/guide)\n3. [Hexo Github Action](https://github.com/marketplace/actions/hexo-action?version=v1.0.4)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrect%2Fsrect.github.io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrect%2Fsrect.github.io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrect%2Fsrect.github.io/lists"}