{"id":13430586,"url":"https://github.com/fi3ework/hexo-theme-archer","last_synced_at":"2025-05-16T01:04:12.193Z","repository":{"id":23819219,"uuid":"99930458","full_name":"fi3ework/hexo-theme-archer","owner":"fi3ework","description":"🎯 A smart and modern theme for Hexo.","archived":false,"fork":false,"pushed_at":"2024-12-25T17:03:55.000Z","size":26929,"stargazers_count":1563,"open_issues_count":19,"forks_count":277,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-09T17:20:21.764Z","etag":null,"topics":["hexo","hexo-blog","hexo-theme","hexo-theme-archer"],"latest_commit_sha":null,"homepage":"https://fi3ework.github.io/hexo-theme-archer","language":"SCSS","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/fi3ework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-08-10T14:13:00.000Z","updated_at":"2025-04-03T23:59:21.000Z","dependencies_parsed_at":"2023-02-18T19:45:32.459Z","dependency_job_id":"d5da68be-59c8-4a18-b7a7-03876e1b479f","html_url":"https://github.com/fi3ework/hexo-theme-archer","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fi3ework%2Fhexo-theme-archer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fi3ework%2Fhexo-theme-archer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fi3ework%2Fhexo-theme-archer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fi3ework%2Fhexo-theme-archer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fi3ework","download_url":"https://codeload.github.com/fi3ework/hexo-theme-archer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"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":["hexo","hexo-blog","hexo-theme","hexo-theme-archer"],"created_at":"2024-07-31T02:00:55.383Z","updated_at":"2025-05-16T01:04:12.164Z","avatar_url":"https://github.com/fi3ework.png","language":"SCSS","funding_links":[],"categories":["Content","SCSS","9 Archer","Hexo themes"],"sub_categories":[],"readme":"# hexo-theme-archer\n\n![preview](./docs/snap.png)\n\n## 在线预览\n\n🎯 主题预览：[Demo](https://fi3ework.github.io/hexo-theme-archer)\n\n## 文档\n\n- [English document](./docs/README-en.md)\n- [二次开发文档](./docs/develop-guide-zh.md)\n\n## 说明\n\n由于作者精力有限，无法保证此主题继续维护，欢迎您 Fork 👋🏻 本仓库或[申请成为维护者 👩‍🔧](https://github.com/fi3ework/hexo-theme-archer/issues/256)。\n\n- 本主题受 [yilia](https://github.com/litten/hexo-theme-yilia) 主题和 [huxpro](https://github.com/Huxpro/huxpro.github.io) 主题的启发，结合了前者的 sidebar 设计及后者的 UI 设计。通过 sidebar 能够快速执行 archive, tag 以及 categories 导航。\n- 兼容性：现代浏览器及 IE10+。\n- 有任何使用上的问题欢迎[发起 issue](https://github.com/fi3ework/hexo-theme-archer/issues/new/choose)。\n\n## 快速安装\n\n### 拉取主题文件\n\n拉取 Archer 主题文件到 `themes/archer` 目录：\n\n``` bash\ngit clone https://github.com/fi3ework/hexo-theme-archer.git themes/archer --depth=1\n```\n\n如果您没有安装 Git，也可以在 Hexo 根目录下手动创建 `themes/archer` 文件夹，下载此仓库的所有代码到该目录下。\n\n### 安装必要依赖\n\nArcher 主题依赖于 `hexo-generator-json-content` 插件生成侧边栏索引，需要在 Hexo 根目录安装此插件：\n\n``` bash\nnpm install hexo-generator-json-content\n```\n\n同时，在 `_config.yml` 中添加如下字段：\n\n``` yaml\njsonContent:\n  meta: true\n  pages: false\n  posts:\n    title: true\n    date: true\n    path: true\n    text: false\n    raw: false\n    content: false\n    slug: false\n    updated: false\n    comments: false\n    link: false\n    permalink: true\n    excerpt: false\n    categories: true\n    tags: true\n```\n\n### 启用 Archer 主题\n\n最后，配置 `_config.yml`，设置 Hexo 主题为 Archer：\n\n``` yaml\ntheme: archer\n```\n\n您成功设置了博客主题 🎇！现在就执行 `hexo s` 命令，在本地预览主题效果吧。\n\n## 主题个性化配置\n\n现在您的项目目录结构应当如下所示：\n\n``` bash\n. # 「Hexo 根目录」\n├── themes\n│   └── archer # 「Archer 主题目录」\n│       └── _config.yml # Archer 主题配置文件\n└── _config.yml # Hexo 配置文件\n```\n\n您可以通过 `hexo -v` 命令，或在 Hexo 根目录下的 `package.json` 中查看您当前使用的 Hexo 版本。\n\n- 如果 **Hexo 版本 \u003e= 5.0.0**，复制 Archer 主题目录下的 `_config.yml` 到 Hexo 根目录，重命名为 `_config.archer.yml`，修改此文件即可对主题进行配置。删除 Archer 主题目录下的 `_config.yml` 文件，或将它重命名为 `_config.yml.template`，避免配置合并或冲突。\n- 如果 **Hexo 版本 \u003e= 2.8.2**，修改 Archer 主题目录下的 `_config.yml` 文件对主题进行配置。\n\n为了与 Hexo 全局配置文件 `_config.yml` 作区分，在后面的介绍中将 Archer 主题配置文件称为 `_config.archer.yml`。\n\n\u003e 这个[维基页面](https://github.com/fi3ework/hexo-theme-archer/wiki/Archer-%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%E4%B8%AD%E6%96%87%E5%8F%82%E8%80%83)包含了主题配置属性的完整中文参考。\n\n可选的 Archer 主题配置内容如下：\n\n- [启用字数统计](#启用字数统计)\n- [配置 About 页面](#配置-about-页面)\n- [配置 404 页面](#配置-404-页面)\n- [启用 RSS 订阅](#启用-rss-订阅)\n- [启用 Mermaid](#启用-mermaid)\n- [启用 LaTeX 数学公式](#启用-latex-数学公式)\n- [启用自定义字体](#启用自定义字体)\n- [自定义单独文章页头图](https://github.com/fi3ework/hexo-theme-archer/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E6%96%87%E7%AB%A0%E9%A1%B5%E5%A4%B4%E5%9B%BE)\n- [将 Unsplash 的随机图片作为头图](https://github.com/fi3ework/hexo-theme-archer/wiki/%E5%B0%86-Unsplash-%E9%9A%8F%E6%9C%BA%E5%9B%BE%E7%89%87%E4%BD%9C%E4%B8%BA%E5%A4%B4%E5%9B%BE)\n- [自定义文章在首页的摘要](https://github.com/fi3ework/hexo-theme-archer/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E6%96%87%E7%AB%A0%E5%9C%A8%E9%A6%96%E9%A1%B5%E7%9A%84%E6%91%98%E8%A6%81)\n- [自定义主题颜色](https://github.com/fi3ework/hexo-theme-archer/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%BB%E9%A2%98%E9%A2%9C%E8%89%B2)\n- [切换代码配色方案](https://github.com/fi3ework/hexo-theme-archer/wiki/%E5%88%87%E6%8D%A2%E4%BB%A3%E7%A0%81%E9%85%8D%E8%89%B2%E6%96%B9%E6%A1%88)\n- [设置文章版权信息](https://github.com/fi3ework/hexo-theme-archer/wiki/%E8%AE%BE%E7%BD%AE%E6%96%87%E7%AB%A0%E7%89%88%E6%9D%83%E4%BF%A1%E6%81%AF)\n- [启用 Algolia 搜索](https://github.com/fi3ework/hexo-theme-archer/wiki/%E5%90%AF%E7%94%A8-Algolia-%E6%90%9C%E7%B4%A2)\n- [切换为英文界面](https://github.com/fi3ework/hexo-theme-archer/wiki/%E8%8B%B1%E6%96%87%E7%95%8C%E9%9D%A2)\n\n### 启用字数统计\n\n在 Hexo 根目录下安装依赖插件：\n\n```bash\nnpm install hexo-wordcount\n```\n\n配置 `_config.archer.yml` 启用字数统计能力：\n\n```yml\nreading_info: true\n```\n\n现在，字数统计信息将显示在博客页面的标题下方。\n\n### 配置 About 页面\n\n在 Hexo 根目录下执行如下命令：\n\n``` bash\nhexo new page \"about\"\n```\n\n在 Hexo 根目录下 `source/about/index.md` 中添加以下内容：\n\n``` markdown\n---\ntitle: 您的自我介绍标题\nlayout: about\n---\n\n您的自我介绍正文\n```\n\n其中 `layout: about` 字段为**必要的**且**不可修改**为其它值。\n\n配置 `_config.archer.yml` 以开启 About 页面：\n\n``` yml\nabout:\n  enable: true\n  image: /intro/about-page.jpg\n```\n\n### 配置 404 页面\n\n在 Hexo 根目录下 `source` 中创建 `404.md`，添加字段如下：\n\n``` markdown\n---\nlayout: 404\ntitle: \"[404]\"\ndescription: \"May the Force be with you :\u0026#41;\"\n---\n```\n\n其中 Front-matter 的 `layout: 404` 字段为**必要的**且**不可修改**为其它值，`title` 字段为您自定义的标题，`description` 字段为 404 页面的自定义描述。\n\n您可以通过配置 `_config.archer.yml` 来修改 404 页面的背景图片：\n\n``` yml\n_404_image: /intro/404-bg.jpg\n```\n\n### 启用 RSS 订阅\n\n在 Hexo 根目录下安装依赖插件：\n\n``` bash\nnpm install hexo-generator-feed --save\n```\n\n配置 `_config.archer.yml`：\n\n```yml\nsocial:\n  rss: /atom.xml\n```\n\n### 启用 Mermaid\n\n[Mermaid](https://github.com/mermaid-js/mermaid) 是一款基于 JavaScript 的流程图和图表工具，它使用 Markdown 定义并渲染各种图表，帮助构建软件工程或各类技术文档。\n\n为了启用 Mermaid，您需要首先在 Hexo 根目录下安装插件 [`hexo-filter-mermaid-diagrams`](https://github.com/webappdevelp/hexo-filter-mermaid-diagrams)：\n\n``` bash\nnpm install hexo-filter-mermaid-diagrams --save\n```\n\n配置 `_config.archer.yml` 以启用 Mermaid：\n\n``` yml\nmermaid:\n  enable: true\n  version: 8.11.0\n  theme: dark\n```\n\n测试 Mermaid 是否启用成功，您可以在任意文章中添加下面的内容（您需要取消缩进）：\n\n``` markdown\n    ``` mermaid\n    graph TD;\n      A--\u003eB;\n      A--\u003eC;\n      B--\u003eD;\n      C--\u003eD;\n    ```\n```\n\n\u003e ❗️❗️❗️ 注意：如果您需要使用**类图**，请编辑您 Hexo 根目录下的 `_config.yml`，设置 `external_link: false`。请确保这个设置对您原来的页面功能没有影响，这是 Hexo 本身的 bug。\n\n### 启用 LaTeX 数学公式\n\n这个[维基页面](https://github.com/fi3ework/hexo-theme-archer/wiki/%E5%90%AF%E7%94%A8-Latex-%E6%94%AF%E6%8C%81)包含启用 LaTeX 数学公式支持的完整介绍。\n\nArcher 主题已经内置了 MathJax，但是您需要**替换 Hexo 默认的 Markdown 渲染引擎**来支持解析 LaTeX 数学公式语法。此示例中将替换为 [`hexo-renderer-pandoc`](https://github.com/wzpan/hexo-renderer-pandoc)。\n\n请留意：替换渲染引擎为 `hexo-renderer-pandoc` 会带来编写上的区别，可能导致一些潜在的问题。\n\n首先，确保系统中已经[安装](https://pandoc.org/installing.html)了 `pandoc`，版本不低于 2.0。\n\n在 Hexo 根目录下执行下面的命令：\n\n``` bash\n# 卸载默认的渲染引擎\nnpm uninstall hexo-renderer-marked --save\n# 安装 hexo-renderer-pandoc\nnpm install hexo-renderer-pandoc --save\n```\n\n配置 `_config.archer.yml` 以启用 LaTeX 数学公式：\n\n``` yml\nmath:\n  mathjax:\n    enable: true\n    version: 3.2.0\n```\n\nArcher 默认不启用 MathJax 渲染 LaTeX 数学公式，因此需要在文章的 Front-matter 中添加 `mathjax: true` 字段。\n\n测试是否启用成功，您可以文章中添加下面的内容进行测试：\n\n``` markdown\n\\begin{equation}\n\\left\\{\n\\begin{array}{lr}\nx=\\dfrac{3\\pi}{2}(1+2t)\\cos(\\dfrac{3\\pi}{2}(1+2t)), \u0026 \\\\\ny=s, \u0026 0 \\leq s \\leq L,|t| \\leq1. \\\\\nz=\\dfrac{3\\pi}{2}(1+2t)\\sin(\\dfrac{3\\pi}{2}(1+2t)), \u0026  \n\\end{array}\n\\right.\n\\end{equation}\n```\n\n### 启用自定义字体\n\n**实验性功能**，自定义字体依赖于 [CSS Variables](https://caniuse.com/?search=CSS%20Variables) 能力，存在**浏览器兼容性问题**。注意：引入体积较大的字体文件（例如中文字体）会**显著降低**博客的访问速度。\n\n配置 `_config.archer.yml` 启用自定义字体能力：\n\n``` yml\ncustom_font:\n  enable: true\n  name: 'Noto Sans SC:n3,n4,n5,n7'\n  url: 'https://cdn.jsdelivr.net/npm/fontsource-noto-sans-sc@4.0.0/chinese-simplified.css'\n```\n\n其中，`name` 为引入的自定义字体名称，`:` 后跟字体变体和字重，不同的变体和字重使用 `,` 间隔。例如 `name: 'Noto Sans SC:i5,n7'` 表示引入 `Noto Sans SC` 的斜体 500 字重和正常 700 字重。\n\n`url` 为引入的自定义字体的 CDN 链接或本地链接。\n\n## 文章 Front-matter 配置\n\nArcher 主题允许您在文章的 Front-matter 处配置如下内容：\n\n- [置顶文章](#置顶文章)：`sticky: number` 或 `top: boolean`\n- [文章打赏](#文章打赏)：`donate: boolean`\n- [文章目录](#文章目录)：`toc: boolean`\n- [翻译的文章](#翻译的文章)：`translated: { author: string; title: string; link: string; }`\n\n### 置顶文章\n\nArcher 主题在主页为置顶的文章显示一个小标记。\n\n在默认情况下，Hexo 使用 [`hexo-generator-index`](https://github.com/hexojs/hexo-generator-index) 生成文章索引。如果您想置顶某篇文章，只需在它的 Front-matter 处添加 `sticky` 属性即可：\n\n``` md\n---\ntitle: Hello World\ndate: 2013/7/13 20:46:25\nsticky: 100\n---\n```\n\n如果您使用了其它的插件生成索引，也可以手动添加 `top` 属性以置顶文章：\n\n``` md\n---\ntitle: Hello World\ndate: 2013/7/13 20:46:25\ntop: true\n---\n```\n\n### 文章打赏\n\n桌面端阅读文章时，会在文章左下角显示打赏按钮，点击后呈现您提供的打赏信息。\n\n您可以配置 `_config.archer.yml` 自定义打赏信息和二维码：\n\n``` yml\ndonate:\n  enable: true # 全局启用打赏按钮\n  title: Buy Me A Coffee\n  description: If this post helped you, please consider buying the author a cup of sugar-free coffee ☕️.\n  qr_code:\n    - url: /path/to/wechat.png\n      alt: Wechat\n    - url: /path/to/alipay.png\n      alt: Alipay\n```\n\n在文章的 Front-matter 处设置的 `donate` 属性具有最高优先级，Archer 主题在渲染时会忽略全局的 `donate.enable` 配置：\n\n``` md\n---\ntitle: Hello World\ndate: 2013/7/13 20:46:25\ndonate: false # 在当前文章隐藏打赏按钮\n---\n```\n\n### 文章目录\n\n桌面端阅读文章时，会在文章右侧显示文章目录。\n\n您可以配置 `_config.archer.yml` **全局**控制文章目录的显示或隐藏：\n\n``` yml\ntoc: true\n```\n\n在文章的 Front-matter 处设置的 `toc` 属性具有最高优先级，Archer 主题在渲染时会忽略全局的配置：\n\n``` md\n---\ntitle: Hello World\ndate: 2013/7/13 20:46:25\ntoc: false # 在当前文章隐藏文章目录\n---\n```\n\n### 翻译的文章\n\n在文章的 Front-matter 中添加 `translated` 字段：\n\n``` markdown\n---\ntranslated:\n  author: Stark-X\n  title: 你好，世界\n  link: https://github.com/\n---\n```\n\n## 更新主题\n\n主题的更新内容发布在仓库的 [Release](https://github.com/fi3ework/hexo-theme-archer/releases) 页面。\n\n提供两种方法供参考：\n\n- 使用 `git` 命令进行更新。可能需要手动合并代码，解决冲突。\n- 备份重要文件后重新克隆，简单粗暴。\n\n### 使用 `git` 命令\n\n在 Archer 主题目录下先执行 `git stash` 将本地的修改暂存，然后执行 `git pull` 获取主题的最新版本，再执行 `git stash pop` 将本地的修改还原，如果合并冲突报错 `CONFLICT`，手动合并解决冲突。\n\n如果自定义了主题，解决完冲突后，执行 `npm run build` 重新生成主题文件。\n\n### 重新克隆主题\n\n首先备份 Archer 主题目录下所有您自定义过的文件（包括 `_config.yml` 和 `source` 下自定义的文件等），然后删除 `themes/archer` 目录，参考文档重新安装主题，最后将备份的文件替换到原来的位置。\n\n## 许可证\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffi3ework%2Fhexo-theme-archer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffi3ework%2Fhexo-theme-archer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffi3ework%2Fhexo-theme-archer/lists"}