# hexo-theme-particlex **Repository Path**: KSweb/hexo-theme-particlex ## Basic Information - **Project Name**: hexo-theme-particlex - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-12-19 - **Last Updated**: 2023-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hexo-Theme-ParticleX [ParticleX](https://github.com/theme-particlex/hexo-theme-particlex) 主题,诞生原因是因为原来的 [Particle](https://github.com/korilin/hexo-theme-particle) 主题不维护了,但是我觉得还是很好的。 原来用的是 Vue 2 + Ant Design Vue 1,现更新到 Vue 3,去除 Ant Design Vue 采用自定义样式,图标更改为 Font Awesome 6,CDN 改为 Staticfile。 原项目 `README.md` 里说: > 目前有 Full、Night 和 Maiden **两个**主题样式。 但是更改后只有一种了,如果你想改颜色就在 `main.css` 里替换吧。 # 1. 演示 - [GitHub Pages](https://argvchs.github.io) - [Netlify](https://argvchs.netlify.app) - [Vercel](https://argvchs.vercel.app) # 2. 安装 ```bash cd themes git clone https://github.com/theme-particlex/hexo-theme-particlex.git particlex --depth=1 ``` 然后在根目录 `_config.yml` 设置主题为 ParticleX 即可。 ```yaml theme: particlex ``` **由于[一些原因](https://github.com/hexojs/hexo/issues/5367),主题与 Hexo 7.0.0 版本不兼容。可以通过降级到 6.3.0 解决。** ```bash # npm npm i hexo@6.3.0 # yarn yarn up hexo@6.3.0 # pnpm pnpm up hexo@6.3.0 ``` ## 2.1. 关闭自带代码高亮 Hexo 有自带的代码高亮,但是和 ParticleX 的不兼容。 ```yaml highlight: enable: false prismjs: enable: false ``` 如果使用 Hexo 7 之后的版本只需要修改为: ```yaml syntax_highlighter: ``` 如果使用 Pandoc 还需要设置一下: ```yaml pandoc: extra: - no-highlight: ``` ## 2.2. 禁用年度月度归档 Hexo 会自动生成年度月度归档,可是 ParticleX 主题没有这个功能。~~我太懒了~~ ```yaml archive_generator: enabled: true per_page: 0 yearly: false monthly: false daily: false ``` 修改完请 `hexo cl` 清除缓存。 # 3. 配置 ## 3.1. 基本配置 `background` 参数是一个列表,打开时会随机加载一个背景。 ```yaml # Avatar image avatar: /images/avatar.jpg # Home page background image background: - /images/background.jpg # Loading image loading: /images/loading.gif # Optional colors for category and tag colors: - "#ffa2c4" - "#00bcd4" - "#03a9f4" - "#00a596" - "#ff7d73" ``` ## 3.2. 内容配置 ### 3.2.1. 导航栏 为了方便,主题使用的图标是 Font Awesome 6 图标。 ```yaml # ParticleX theme icon is adopts the Font Awesome 6 # https://fontawesome.com # Main menu navigation menu: Home: name: house theme: solid link: / About: name: id-card theme: solid link: /about Archives: name: box-archive theme: solid link: /archives Categories: name: bookmark theme: solid link: /categories Tags: name: tags theme: solid link: /tags ``` ### 3.2.2. 主页信息卡片 `description` 支持 Markdown 格式。 图标链接 `iconLinks` 配置和导航栏配置相同。 ```yaml # Side info card card: enable: true description: | Description ... iconLinks: friendLinks: Argvchs: https://argvchs.github.io ``` ### 3.2.3. 页脚 考虑到博客部署在服务器并使用自己域名的情况,按规定需要在网站下边添加备案消息。 如没有需要显示备案消息的可以关闭。 ```yaml # Footer info footer: since: 2022 # Customize the server domain name ICP ICP: enable: false code: link: ``` ## 3.3. 功能配置 ### 3.3.1. Polyfill 使用 [Polyfill.io](https://polyfill.io) 自动根据 UA 处理新的 JS API 兼容。 可以配合 [Hexo-Babel](https://github.com/theme-particlex/hexo-babel) 插件处理 JS 语法兼容。 ```yaml # Polyfill # https://polyfill.io polyfill: enable: true features: - default ``` ### 3.3.2. 代码高亮 使用 Highlight.js 代码高亮。 样式可以在[这里](https://highlightjs.org/static/demo)选择,默认为 GitHub。 ```yaml # Highlight.js # https://highlightjs.org highlight: enable: true style: github ``` ### 3.3.3. 数学渲染 使用 KaTeX 渲染数学公式。 ```yaml # KaTeX math rendering math: enable: false ``` ### 3.3.4. 图片预览 简单的点击图片放大缩小的预览。 ```yaml # Image preview preview: enable: true ``` ### 3.3.5. 文章缩略 一般来说,缩略展示文档只需要在文档中添加 `` 即可,缩略内容在显示全文中也会出现。 但考虑到不想把缩略内容放在正文里,就添加了此参数,在 [Front-Matter](https://hexo.io/docs/front-matter) 里设置。 支持 Markdown 格式。 ```yaml description: | Normal _Italic_ **Strong** ``` ### 3.3.6. 文章置顶 在 [Front-Matter](https://hexo.io/docs/front-matter) 里设置 `pinned` 作为置顶参数,越大越靠前,默认为 0。 ### 3.3.7. 文章加密 使用 AES 加密算法,在 [Front-Matter](https://hexo.io/docs/front-matter) 里设置 `secret` 作为密码,**使用请安装插件 [Hexo-Helper-Crypto](https://github.com/theme-particlex/hexo-helper-crypto)**。 ```yaml # Article encryption crypto: enable: false ``` ### 3.3.8. 搜索 嵌入到 Archives 中的搜索。 目前只支持搜索文档标题。 ```yaml # Search search: enable: false ``` ## 3.4. 评论配置 ### 3.4.1. Giscus Giscus 是一个由 GitHub Discussions 支持的评论系统。 在 [Giscus.app](https://giscus.app) 设置好各项后,会在下面生成一个 `