Giter Site home page Giter Site logo

yue-plus / hexo-theme-arknights Goto Github PK

View Code? Open in Web Editor NEW
642.0 8.0 68.0 4.75 MB

明日方舟罗德岛阵营的 Hexo 主题,支持数学公式、Valine&Gitalk&Waline评论系统、Mermaid图表

Home Page: https://arknights.theme.hexo.yue.zone/

License: MIT License

HTML 0.82% TypeScript 13.22% JavaScript 44.70% Pug 10.83% Stylus 27.76% CSS 2.65%
hexo hexo-theme arknights mathjax valine mermaid gitalk

hexo-theme-arknights's Introduction

| 简体中文 | English | 日本語 |

hexo-theme-arknights

预览

如果使用了这个主题,欢迎在这儿贴预览链接~

主题预览图片

安装

环境

使用 hexo-cli 新建博客项目:

hexo init Hexo
cd Hexo
cnpm install
git clone https://github.com/Yue-plus/hexo-theme-arknights.git themes/arknights

安装依赖

npm 用户:

cnpm install hexo-server hexo-browsersync hexo-renderer-pug --save

yarn 用户:

yarn add hexo-server hexo-browsersync hexo-renderer-pug

修改配置文件

修改资源文件

可按需在 Hexo/source/ 目录添加以下文件:

  • CNAME: GitHub Pages 部署时的自定义域名
  • img/ 目录下的 Alipay.pngWeChat.png 为自己的收款二维码(1:1 比例的 png 图片);

可按需修改 Hexo/themes/arknights/source/ 目录下的:

  • favicon.ico:浏览器标签页上的图标(64*64,分辨率高了显示不出)
  • README.md: 部署仓库的 README

写作

  • 参考 写作 | Hexo

  • 在主题仓库的 Hexo 分支有一些 示例文本 可以取用

  • 添加文章标签与分类,更多特性可参考 Hexo | Front-matter ,示例:

    ---
    title: 'Hello World !'
    date: 2020-04-15 21:54:02
    tags: code
    category: Example
    ---
  • <!-- more --> 之前的内容称之为摘要,会显示在首页上,并且可以设置是否也在正文显示。

在导航栏中添加页面

  • 例如:新建一个 about 页面

    • Hexo 目录下执行 hexo new page 'about'
    • 然后 Hexo/source/ 目录下会多一个 about 文件夹
  • 编辑 Hexo/source/about/index.md 文件

  • 编辑 _config.arknights.yml,添加一个链接:

    menu:
      About: /about

禁止归档页翻页

该设置位于 Hexo 配置文件 _config.yml 约第 88 行。

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

per_page: 改为 0 即可。

评论系统

Valine

本主题支持Valine 。 请参考 Valine 快速开始 修改 Hexo 目录下的 _config.arknights.yml 文件:

valine:
  enable: false
  app_id: # APP ID
  app_key: # APP KEY
  server_url: # APP DOMAIN(LeanCloud 国际版)

开启邮件提醒:zhaojun1998 / Valine-Admin

注意! 当 Valine 使用 LeanCloud 国际版 时,才需要配置 server_url:
该设置可在 LeanCloud 应用中的 设置 -> 应用凭证 -> 域名白名单 -> Request 域名 中找到以 .api.lncldglobal.com 结尾的域名,加上 https:// 前缀即可。

Gitalk

本主题支持 Gitalk 。 请参考 gitalk/readme-cn.md 修改 Hexo 目录下的 _config.arknights.yml 文件:

gitalk:
  enable: false
  client_id: # GitHub 应用 Client ID
  client_secret: # GitHub 应用 Client Secret
  repo: # 用于存放评论数据的 GitHub 仓库
  owner: # 该 GitHub 仓库所有者
  admin: [] # 具有写该 GitHub 仓库权限的用户
            # 例如: [adminA,adminB]
  id: # (可选) 页面的唯一标识
      # 例如: location.pathname

Waline

本主题支持 Waline
请参考 Waline 官方文档 修改 Hexo 目录下的 _config.arknights.yml 文件:

waline:
  enable: false 
  server_url: # Server_Url

Artalk

本主题支持 Artalk
请参考 Artalk 官方文档修改 Hexo 目录下的 _config.arknights.yml 文件:

artalk:
  enable: false
  server: https://artalk.server.instance/ # 你的 Artalk 服务地址
  site_name: My Blog # 站点名称,用于区分多个站点(可选)

数学公式

本主题支持两种方案显示数学公式:

方案一:静态渲染

可以使用 hexo-filter-mathjax Hexo 过滤器静态渲染,来显示数学公式。

建议先更换能更好处理数学公式的 markdown 渲染器 hexo-renderer-pandoc

  1. 在 Hexo 目录下执行以下指令:

    # 安装 hexo-filter-mathjax 插件
    cnpm install hexo-filter-mathjax --save
    # 清除缓存
    hexo clean
  2. 把以下内容添加到 Hexo/_config.yml 文件:

    mathjax:
      tags: none # 或 'ams' 或 'all'
      single_dollars: true # 启用单个美元符号作为内联(行内)数学公式定界符
      cjk_width: 0.9 # 相对 CJK 字符宽度
      normal_width: 0.6 # 相对正常(等宽)宽度
      append_css: true # 将 CSS 添加到每个页面
      every_page: false # 如果为 true,那么无论每篇文章的前题中的 `mathjax` 设置如何,每页都将由 mathjax 呈现
  3. 在需要启用 mathjax 的文章的 Front-matter 区内添加 mathjax: true

    ---
    title: On the Electrodynamics of Moving Bodies
    categories: Physics
    date: 1905-06-30 12:00:00
    mathjax: true
    ---

    然后,就可以在文章中使用 LaTeX 语法。

  4. 需要注意,内联数学公式(…… $<数学公式>$ ……)在开头 $ 之后和结尾 $ 之前不能有空格!例如:

    - $ \epsilon_0 $
    + $\epsilon_0$
    - $ \frac{\partial}{\partial t} $
    + $\frac{\partial}{\partial t}$
  5. 需要注意 LaTeX 与 Markdown 语法之间的冲突。如有必要,请使用 \ 进行转义:

    - $\epsilon_0$
    + $\epsilon\_0$
    - \begin{eqnarray*}
    + \begin{eqnarray\*}

方案二:动态渲染

本主题也支持 MathJax ,在用户浏览时动态渲染公式:

  1. 首先要卸载 Hexo 默认自带的 hexo-renderer-marked 渲染器,更换成对 MathJax 支持更好的 hexo-renderer-kramed 渲染器:

    npm uninstall hexo-renderer-marked --save
    npm install hexo-renderer-kramed --save
  2. 修改 Hexo 目录 下的 _config.arknights.yml 文件:

      # 公式支持
      mathjax:
    -   enable: false
    +   enable: true
      version: '2.6.1'  # 重要
  3. 然后,就可以在文章中使用 LaTeX 语法:

    % 单行内联公式
    % 注意需要两边带上 "`" ,且 "`" 与 "$" 之间不能有空格
    `$\sigma$`
    
    % 多行公式
    $$
    \begin{aligned}f(x) &= \sum_{i=1}^{\infty}{\frac{x}{2^i}} \\
    &= x\end{aligned}
    $$
  4. 用这种方案,不会造成 LaTeX 与 Markdown 语法之间的冲突。在文中使用 LaTeX 语法不需要转义。 以下公式可以直接使用,不会造成任何问题:

    \epsilon_0
    \begin{eqnarray*}

hexo-renderer-kramed 插件还有其他可配置项,请参考插件文档: https://github.com/sun11/hexo-renderer-kramed

几种公式显示方案各有优缺点:

  1. 动态渲染方案 LaTeX 语法不需要转义,能更好的支持从其他地方导出的 Markdown 文件。但因为需要在浏览器渲染,页面显示会略有延迟。
  2. 静态渲染方案将公式直接编译在静态文件里,显示性能更优,但语法需要转义。
  3. hexo-renderer-pandoc 快速显示公式而不必经历转义语法的麻烦,但需要安装 Pandoc。

图表支持

修改 Hexo 目录 下的 _config.arknights.yml 文件:

  # 图表支持
  mermaid:
-   enable: false
+   enable: true
    version: '8.13.5'

主题通过 mermaid-js 绘制各种图表。查看示例

支持: 流程图 | 序列图 | 类图 | 状态图 | 实体关系图 | 用户旅程图 | 甘特图 | 指令图 | 饼图

语法:

<div class="mermaid">
  graph LR
  A[Hard edge] -->|Link text| B(Round edge)
  B --> C{Decision}
  C -->|One| D[Result one]
  C -->|Two| E[Result two]
</div>

如果习惯使用 代码块 也完全支持。

字数/阅读时长统计

依赖 hexo-wordcount

npm 用户:

cnpm install hexo-wordcount --save

yarn 用户:

yarn add hexo-wordcount

之后修改 Hexo 目录 下的 _config.arknights.yml 文件:

post:
  count: true # 是否显示字数统计
  time: true # 是否显示阅读时长统计

浏览量统计

使用 不蒜子 进行浏览量统计。 修改 Hexo 目录 下的 _config.arknights.yml 文件启用该功能:

busuanzi:
  enable: false
  sitePV: true # 站点总访问量
  siteUV: true # 站点访客数
  pagePV: true # 页面访问量

文档加密

经过修改的 hexo-blog-encrypt 插件已适配并集成在本主题中(目前仅支持 default 与 up 主题)。

详细配置参考 hexo-blog-encrypt/ReadMe.zh.md

Hexo/_config.yml 文件中添加以下内容:

# Security
encrypt: # hexo-blog-encrypt
  abstract: 与 Rhodes Island™ 取得弱神经连接时需要口令
  message: 请输入与 Rhodes Island™ 取得弱神经连接时的口令:
  tags:
  - {name: tagName, password: 密码A}
  - {name: tagName, password: 密码B}
  wrong_pass_message: 与 Rhodes Island™ 效验口令失败,请重试。
  wrong_hash_message: 与 Rhodes Island™ 效验口令失败,当前使用临时权限查看。

在文章的 Front-matter 区内设置:

---
title: Hello World
tags:
- 作为日记加密
date: 2016-03-30 21:12:21
password: mikemessi
abstract: 与 Rhodes Island™ 取得弱神经连接时需要口令
message: 请输入与 Rhodes Island™ 取得弱神经连接时的口令:
wrong_pass_message: 与 Rhodes Island™ 效验口令失败,请重试。
wrong_hash_message: 与 Rhodes Island™ 效验口令失败,当前使用临时权限查看。
---

搜索

默认开启,若要关闭,在 Hexo/_config.arknights.yml 文件中:

search:
  enable: false

Front-matter

除了 Hexo 支持的 Front-matter 还支持:

# 文章页右上角发布/更新日期
post-info: true/false

# 侧边栏的目录
post-index: true/false

# 打赏框
reward: true/false

引入自定义 CSS/JS 文件

可以在 Hexo/source/css/ 目录下放入自己的 CSS 文件; 在 Hexo/source/js/ 目录下放入自己的 JavaScript 脚本文件;

然后修改 Hexo/_config.arknights.yml 文件:

  # 在 `<head>` 标签内引入 CSS 样式表
  stylesheets:
+ - /css/custom.css
  
  # 在 `<body>` 尾部引入 JavaScript 脚本
  scripts:
+ - /js/custom.js

资源文件夹是存放用户资源的地方。 除 _posts 文件夹之外,开头命名为 _ (下划线)的文件/文件夹和隐藏的文件将会被忽略。 Markdown 和 HTML 文件会被解析并放到 public 文件夹,而其他文件会被拷贝过去。

——来自 Hexo 官方文档

参与开发

欢迎提交 IssuesPR

分支说明

分支 说明
main 相对稳定的版本
gh-pages gh-page 托管
hexo Hexo 目录,这里有可以用于测试主题的 .md 文件

开发中可能遇见的问题及解决方法

修改 TS 文件不生效

TypeScript 需要手动编译,请全局安装 typescript 后在 arknights\source\js\_src 目录下执行 tsc 以编译。

运行 hexo serve --debug 时,长文章渲染不全

这是由热重载插件 hexo-browsersync 导致的,不会影响发布。

解决方法:禁用该插件。(反正不影响发布,不管也行)

参与开发可能需要的文档

贡献者

支援主题开发

喜欢这个主题的话可以:

  • 给颗小星星吧 (/▽\)
  • 开发者的B服ID:24444750
  • 加入 QQ 群:618221514

    群内开发为主,吹水晒卡,分享线索7也都欢迎哦~ d=====( ̄▽ ̄*)b

  • 打赏、赞助: 收款二维码

hexo-theme-arknights's People

Contributors

angine04 avatar arkerny avatar chisatonishikigi73 avatar darklingyun avatar feilongproject avatar laurenfrost avatar longfengshuanwu avatar madisontanle avatar ryojerryyu avatar sherkeyxd avatar sjfhsjfh avatar soundofautumn avatar thexvoilone avatar tounvrse avatar ttsdzb avatar wmz1024 avatar yue-plus avatar zhongye1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hexo-theme-arknights's Issues

菜单上的文章内展示错误

添加到菜单里的页面(比如about、todo,相对链接为/xxx/index.html)等,在浏览其界面时无法显示评论、目录等(即使在文章内加入commit: true),希望能修复一下。

增加字数统计和阅读时长

  1. 文章页显示字数和阅读时长(阅读时长相比不那么重要,能加上更好)
  2. 博客侧边栏可也加上全站字数
    以上效果图类似如下:
    image
    image

关于搜索

建议将在边栏搜索更改为一个窗口搜索,个人认为在左边栏搜索有失美观,并显得杂乱无章。

error TS2305

启动之后一直报错,不知道是为什么QAQ

>> hexo s                                                                                                                                                                                                  
INFO  Validating config
INFO  Start processing
[Browsersync] Access URLs:
 ----------------------------------
          UI: http://localhost:3001
 ----------------------------------
 UI External: http://localhost:3001
 ----------------------------------
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
ERROR node_modules/_@[email protected]@@types/babel-types/index.d.ts(10,15): error TS2307: Cannot find module './ts3.6/index' or its corresponding type declarations.
。。。
ERROR node_modules/_@[email protected]@@types/babel-types/index.d.ts(244,109): error TS2307: Cannot find module './ts3.6/index' or its corresponding type declarations.
ERROR node_modules/_@[email protected]@@types/babylon/index.d.ts(8,10): error TS2305: Module '"./node_modules/@types/babel-types"' has no exported member 'File'.
ERROR node_modules/_@[email protected]@@types/babylon/index.d.ts(8,16): error TS2305: Module '"./node_modules/@types/babel-types"' has no exported member 'Expression'.

希望能在配置文件声明 mermaid 的版本

自己平时也习惯在 markdown 里用 mermaid 画流程图,一般使用 8.13.3 版本进行渲染。

最近在尝试这个主题时,发现平时写的一些可渲染的 mermaid 没法被渲染,显示 Syntax error
初步估计是 mermaid 版本原因。(因为我看源码里引用 mermaid 的版本为 8.11.0

由于我是使用 git submodule 的方式来引用这个主题,不方便直接修改源码。
希望能够将使用的 mermaid 版本加到配置中,这样我就能在自己项目中以 _config.[theme].yml 文件的方式设定 mermaid 的版本。

hexo g报错

ERROR {
err: SyntaxError: Unexpected token ] in JSON at position 40
at JSON.parse ()
at Hexo.jsonRenderer (D:\Workplace\Blog\node_modules\hexo\lib\plugins\renderer\json.js:4:15)
at Hexo.tryCatcher (D:\Workplace\Blog\node_modules\bluebird\js\release\util.js:16:23)
at Hexo. (D:\Workplace\Blog\node_modules\bluebird\js\release\method.js:15:34)
at D:\Workplace\Blog\node_modules\hexo\lib\hexo\render.js:81:22
at tryCatcher (D:\Workplace\Blog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Workplace\Blog\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\Workplace\Blog\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Workplace\Blog\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Workplace\Blog\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (D:\Workplace\Blog\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (D:\Workplace\Blog\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (D:\Workplace\Blog\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (D:\Workplace\Blog\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (node:internal/timers:466:21)

hexo生成问题,报错如下

`ERROR
TypeError: D:\blog\Hexo\themes\arknights\layout\post.pug:4
2|
3| block content

4| -
5| const prev = page.prev
6| const next = page.next
7| const dateConf = theme.post.date

wordcount is not a function
at eval (eval at wrap (D:\blog\Hexo\node_modules\pug-runtime\wrap.js:6:10), :457:52)
at template (eval at wrap (D:\blog\Hexo\node_modules\pug-runtime\wrap.js:6:10), :1102:7)
at _View._compiled (D:\blog\Hexo\node_modules\hexo\lib\theme\view.js:136:50)
at _View.render (D:\blog\Hexo\node_modules\hexo\lib\theme\view.js:39:17)
at D:\blog\Hexo\node_modules\hexo\lib\hexo\index.js:64:21
at tryCatcher (D:\blog\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at D:\blog\Hexo\node_modules\bluebird\js\release\method.js:15:34
at RouteStream.read (D:\blog\Hexo\node_modules\hexo\lib\hexo\router.js:47:5)
at RouteStream.Readable.read (node:internal/streams/readable:487:10)
at resume
(node:internal/streams/readable:987:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)`

怎么处理?

希望增加对于pjax的支持

原因(废话):本人刚入门,一晚上时间就加了个hexo-tag-aplayer的插件,但是在遇到不同页面跳转时,音乐会强制中断,如果想要继续播放的话,只能用pjax,本人低技术力,所以请大佬做个对pjax的支持,多谢了!

增加404页面的支持

RT,在用github pages等静态页面托管时,如果链接404了,可以直接导航到网站主页或者上一页,而不是用着默认的页面

仍然没有代码块折叠

如题,虽然是最新版本,但是现在代码块还是这样的:
代码块截图

另外浏览器控制台会报两个错误:
控制台报错
一旦报这个错,跟着鼠标走的圈圈和左侧栏折叠之类的靠 js 的功能也就一起失效了。我看了一下好像你那里(https://ark.theme.yueplus.ink/)也会报这个错。只有有代码块的文章会报错。

package.json

{
  "name": "ttsdzb-hexo",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "6.2.0"
  },
  "dependencies": {
    "hexo": "^6.0.0",
    "hexo-blog-encrypt": "^3.1.6",
    "hexo-browsersync": "^0.3.0",
    "hexo-filter-mathjax": "^0.8.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-searchdb": "^1.4.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^5.0.0",
    "hexo-renderer-pug": "^3.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3"
  }
}

_config.yml

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: 'TTsdzb'
subtitle: 'blog'
description: '一些笔记或是知识分享。'
keywords:
author: Dr.TTsdzb
language: zh
timezone: 'Asia/Shanghai'

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://blog.ttsdzb.monster
permalink: :title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
auto_spacing: true
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: true
marked:
  prependRoot: true
  postAsset: true
relative_link: true
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: true
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: arknights

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: ''

# Search
search:
  enable: true
  preload: true # 非必要
  path: search.json # 非必要,缩小文件用
  format: striptags # 非必要,缩小文件用(该选项能极大缩小搜索数据文件大小,建议开启)

# Mathjax
mathjax:
  tags: none # 或 'ams' 或 'all'
  single_dollars: true # 启用单个美元符号作为内联(行内)数学公式定界符
  cjk_width: 0.9 # 相对 CJK 字符宽度
  normal_width: 0.6 # 相对正常(等宽)宽度
  append_css: true # 将 CSS 添加到每个页面
  every_page: false # 如果为 true,那么无论每篇文章的前题中的 `mathjax` 设置如何,每页都将由 mathjax 呈现

_config.arknights.yml

# html lang
language: zh

# canvas 动态背景
canvas_dust: false

# <body> 背景图片链接
background_image: https://ak.hypergryph.com/assets/index/images/ak/pc/bk.jpg # /img/bg.jpg

# 侧边栏
aside:
  in_left: false # 侧边栏在左 true / false
  logo: https://ak.hypergryph.com/assets/index/images/ak/pc/faction/1.png # 图片链接,建议 1:1 比例
  dr: / # 侧边栏 Dr. 链接
  copyright: # 版权声明、备案号等,可自定义键值,不想显示则留空

# post 文章页面配置;true / false
post:
  date: true # 是否显示发布日期
  updated: true # 是否显示修改日期
  source: false # 是否显示源文件路径
  word_count: false # 是否显示字数统计
  reading_time: false # 是否显示预计阅读时长
  excerpt: false # 是否在文章中显示摘要内容(<!-- more--> 以上的内容)
  reward: false # 文章末显示打赏二维码
# 文章内目录
toc:
  list_number: true # true / false ;是否显示编号
  max_depth: 6 # 最大目录深度
  min_depth: 1 # 最小目录深度
# 归档页;true / false
archives:
  categories_count: true # 是否显示分类总数
  tags_count: true # 是否显示标签总数

# 搜索框
search:
  enable: true

# Valine 无后端评论系统
valine:
  enable: false
  app_id: # APP ID
  app_key: # APP KEY
  server_url: # APP DOMAIN(LeanCloud 国际版)

gitalk:
  enable: false
  client_id: # GitHub Application Client ID
  client_secret: # GitHub Application Client Secret
  repo: # GitHub repository
  owner: # GitHub repository owner
  admin: [] # GitHub repository owner and collaborators (Users who having write access to this repository)
            # Example: [adminA,adminB]
  id: # (optional) The unique id of the page
      # Example: location.pathname

# 图表支持
mermaid:
  enable: false
  version: '8.13.5'

# pjax 支持 —— 实验性测试阶段,请谨慎开启
pjax:
  enable: false
  version: '0.2.8'

mathjax:
  enabled: false

# main menu navigation
menu:
  Home: ''
#  Contact: contact/
  Archives: archives/
  About: about/

# stylesheets loaded in the <head>
stylesheets:
- //unpkg.com/@highlightjs/[email protected]/styles/atom-one-dark-reasonable.min.css

# scripts loaded in the end of the body
scripts:
- //unpkg.com/@highlightjs/[email protected]/highlight.min.js

markdown在标题前没有空行可能导致奇怪的缩进

markdown在标题前没有空行可能导致奇怪的缩进

形如:

- a
- b
# title

会导致title被缩进,大概是这个样子的,并且会造成目录等的混乱屏幕截图2022-06-11

- a
- b

# title

不会导致title被缩进。

vs-code里有个叫markdown-formatter的插件会格式化成第一种情况,markdown all in one不会进行改动,prettier-code formater则会格式化为第二种情况。

我用的是较老版本的主题(2022年2月左右的),如果该问题已经被解决,请关闭或者删除此issue,谢谢。

未知的报错,但似乎不影响正常使用

ERROR {
err: SyntaxError: Unexpected token / in JSON at position 29
at JSON.parse ()
at Hexo.jsonRenderer (E:\VSCodeFiles\SherkeyBlog\node_modules\hexo\lib\plugins\renderer\json.js:4:15)
at Hexo.tryCatcher (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\util.js:16:23)
at Hexo. (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\method.js:15:34)
at E:\VSCodeFiles\SherkeyBlog\node_modules\hexo\lib\hexo\render.js:81:22
at tryCatcher (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (E:\VSCodeFiles\SherkeyBlog\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (node:internal/timers:464:21)
} Asset render failed: %s js/tsconfig.json

希望添加二级菜单功能

理想中的menu配置:

menu:
    记录终端:
        罗德岛日常: record/day/
        这片大地: record/earth/
        罗德岛日报: categories/news/

实现之后可以在主菜单使用鼠标悬浮/单击之后,出现二级菜单功能

希望增加社交链接功能

(自己写的代码太丑,希望大佬改一下)
我的代码

  1. layout.pug中的
#total-categories
  span.total-title Categories:
  span.total-number= site.categories.length

后面添加

link(rel="stylesheet", href="/css/about_me.css")
#about_me.about_me
  br
  a(href=theme.social.github.url)
    img(src=theme.social.github.img, alt="social-github")
  a(href=theme.social.weibo.url)
    img(src=theme.social.weibo.img, alt="social-weibo")
  a(href=theme.social.wyy.url)
    img(src=theme.social.wyy.img, alt="social-wyy")
  a(href=theme.social.email.url)
    img(src=theme.social.email.img, alt="social-email")
  a(href=theme.social.wechat.url)
    img(src=theme.social.wechat.img, alt="social-wechat")
  a(href=theme.social.zhihu.url)
    img(src=theme.social.zhihu.img, alt="social-zhihu")
  a(href=theme.social.qq.url)
    img(src=theme.social.qq.img, alt="social-qq")
  1. about_me.css中(特地建了一个文件,好浪费)
.about_me img {
    height: 20px;
    width: 20px
}
  1. 在主题配置文件中
social:
  github: 
    url: https://github.com/feilongproject
    img: https://cdn.jsdelivr.net/gh/honjun/[email protected]/img/social/github.png
  weibo:
    url: https://weibo.com/feilongproject
    img: https://cdn.jsdelivr.net/gh/honjun/[email protected]/img/social/sina.png
  wyy:
    url: https://music.163.com/user?id=1374209960
    img: https://cdn.jsdelivr.net/gh/honjun/[email protected]/img/social/wangyiyun.png
  zhihu:
    url: #
    img: https://cdn.jsdelivr.net/gh/honjun/[email protected]/img/social/zhihu.png
  email:
    url: mailto:[email protected]
    img: https://cdn.jsdelivr.net/gh/honjun/[email protected]/img/social/email.svg
  wechat: 
    url:
    rcode: https://feilongproject.github.io/img/donate/wechat.jpg
    img: https://cdn.jsdelivr.net/gh/honjun/[email protected]/img/social/wechat.png
  qq:
    url: https://wpa.qq.com/msgrd?v=3&uin=1728904631&site=qq&menu=yes
    img: https://im.qq.com/favicon.ico

图示
Snipaste_2020-08-21_17-23-26.jpg
注:从明天起就要高一住校了,再也提不了issues了(哭唧唧)

使用 hexo g 生成静态文件时无法生成 arknights.css

RT,控制台输出如下

F:\#HexoBlog\blog>hexo clean && hexo g
INFO  Validating config
INFO  Deleted database.
INFO  Deleted public folder.
INFO  Validating config
INFO  Start processing
INFO  Files loaded in 3.55 s
ERROR {
  err: TypeError: F:/#HexoBlog/blog/themes/arknights/source/css/_core/aside.styl:75:14
     71|
     72| #aside-block
     73|   transition .3s
     74|   margin-top 10px
     75|   background linear-gradient(rgba(20, 21, 22, 0.8), #0000)
  --------------------^
     76|   #total-archives .total-number
     77|     letter-spacing 2px
     78|   @media ( min-width 769px )

  Cannot read properties of undefined (reading 'nodes')
      at "#aside-block" (F:/#HexoBlog/blog/themes/arknights/source/css/_core/aside.styl:73:1)

      at Evaluator.vendors (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:1570:32)
      at Evaluator.unvendorize (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:1584:30)
      at Evaluator.visitCall (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:484:24)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitExpression (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:644:26)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitProperty (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:687:22)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitBlock (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:720:39)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitGroup (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:261:22)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.visitBlock (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:720:39)
      at Evaluator.Visitor.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\index.js:28:40)
      at Evaluator.visit (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:160:18)
      at Evaluator.importFile (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:99:18)
      at Evaluator.visitImport (F:\#HexoBlog\blog\node_modules\stylus\lib\visitor\evaluator.js:920:27) {
    lineno: 75,
    column: 14,
    filename: 'F:/#HexoBlog/blog/themes/arknights/source/css/_core/aside.styl',
    stylusStack: '    at "#aside-block" (F:/#HexoBlog/blog/themes/arknights/source/css/_core/aside.styl:73:1)',
    input: 'aside\r\n' +
      '  &::-webkit-scrollbar\r\n' +
      '    display none\r\n' +
      '  &::-ms-scrollbar\r\n' +
      '    display none\r\n' +
      '  scrollbar-width none\r\n' +
      '  height 100vh\r\n' +
      '  position sticky\r\n' +
      '  display flex\r\n' +
      '  flex-direction column\r\n' +
      '  justify-content space-between\r\n' +
      '  align-content stretch\r\n' +
      '  overflow-y auto\r\n' +
      '  overflow-x hidden\r\n' +
      '  color #fff\r\n' +
      '  padding 0 20px\r\n' +
      '  h1\r\n' +
      '    font-family BenderLight, sans-serif\r\n' +
      '    margin-top 0\r\n' +
      '  footer\r\n' +
      '    color #898989\r\n' +
      '    padding 0 3px 30px 3px\r\n' +
      '    font-family BenderLight\r\n' +
      '\r\n' +
      '#logo\r\n' +
      '  user-select none\r\n' +
      '  width 100%\r\n' +
      '  height 5px\r\n' +
      '  display inline-block\r\n' +
      '  margin-bottom 100%\r\n' +
      '  padding 0\r\n' +
      '  img\r\n' +
      '    width 100%\r\n' +
      '\r\n' +
      '#Dr\r\n' +
      '  text-align center\r\n' +
      '  a\r\n' +
      '    color #fff\r\n' +
      '\r\n' +
      '#total\r\n' +
      '  margin 10px 0\r\n' +
      '  font-family BenderLight\r\n' +
      '  div\r\n' +
      '    display inline-block\r\n' +
      '\r\n' +
      '#total-archives\r\n' +
      '  color #fff\r\n' +
      '  box-sizing border-box\r\n' +
      '  width 100%\r\n' +
      '  border-left 5px solid #fff\r\n' +
      '  padding 0 0 0 10px\r\n' +
      '  display inline-block\r\n' +
      '  transition 1s\r\n' +
      '  .total-title\r\n' +
      '    font-size 23px\r\n' +
      '    display block\r\n' +
      '  .total-number\r\n' +
      '    font-weight bolder\r\n' +
      '    font-size 52px\r\n' +
      '    padding 0 10px\r\n' +
      '    transition .8s\r\n' +
      '  @media ( min-width 769px )\r\n' +
      '    &:hover\r\n' +
      '      border-color #2bf\r\n' +
      '      background-color rgba(#fff, .1)\r\n' +
      '      .total-number\r\n' +
      '        color #2bf\r\n' +
      '\r\n' +
      '#total-tags, #total-categories\r\n' +
      '  margin 15px 0 0 15px\r\n' +
      '\r\n' +
      '#aside-block\r\n' +
      '  transition .3s\r\n' +
      '  margin-top 10px\r\n' +
      '  background linear-gradient(rgba(20, 21, 22, 0.8), #0000)\r\n' +
      '  #total-archives .total-number\r\n' +
      '    letter-spacing 2px\r\n' +
      '  @media ( min-width 769px )\r\n' +
      '    &:hover h1\r\n' +
      '      background-color #2bf\r\n' +
      '  h1\r\n' +
      '    transition 1s\r\n' +
      '    color #000\r\n' +
      '    background-color #fff\r\n' +
      '    margin 0\r\n' +
      '    padding 0 10px\r\n' +
      '    font-size medium\r\n' +
      '\r\n' +
      '#description p\r\n' +
      '  margin unset\r\n' +
      '  text-align center\r\n'
  }
} Asset render failed: %s css/arknights.css
ERROR {
  err: SyntaxError: Unexpected token ] in JSON at position 40
      at JSON.parse (<anonymous>)
      at Hexo.jsonRenderer (F:\#HexoBlog\blog\node_modules\hexo\lib\plugins\renderer\json.js:4:15)
      at Hexo.tryCatcher (F:\#HexoBlog\blog\node_modules\bluebird\js\release\util.js:16:23)
      at Hexo.<anonymous> (F:\#HexoBlog\blog\node_modules\bluebird\js\release\method.js:15:34)
      at F:\#HexoBlog\blog\node_modules\hexo\lib\hexo\render.js:81:22
      at tryCatcher (F:\#HexoBlog\blog\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (F:\#HexoBlog\blog\node_modules\bluebird\js\release\promise.js:547:31)
      at Promise._settlePromise (F:\#HexoBlog\blog\node_modules\bluebird\js\release\promise.js:604:18)
      at Promise._settlePromise0 (F:\#HexoBlog\blog\node_modules\bluebird\js\release\promise.js:649:10)
      at Promise._settlePromises (F:\#HexoBlog\blog\node_modules\bluebird\js\release\promise.js:729:18)
      at _drainQueueStep (F:\#HexoBlog\blog\node_modules\bluebird\js\release\async.js:93:12)
      at _drainQueue (F:\#HexoBlog\blog\node_modules\bluebird\js\release\async.js:86:9)
      at Async._drainQueues (F:\#HexoBlog\blog\node_modules\bluebird\js\release\async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (F:\#HexoBlog\blog\node_modules\bluebird\js\release\async.js:15:14)
      at processImmediate (node:internal/timers:466:21)
} Asset render failed: %s js/tsconfig.json
INFO  Generated: search.json
INFO  Generated: archives/2022/05/index.html
INFO  Generated: archives/index.html
INFO  Generated: archives/2022/index.html
INFO  Generated: index.html
INFO  Generated: font/Geometos.ttf
INFO  Generated: cursor-inner.png
INFO  Generated: favicon.ico
INFO  Generated: css/arknights.css
INFO  Generated: font/JetBrainsMono-Regular.woff2
INFO  Generated: font/BenderLight.ttf
INFO  Generated: js/search.js
INFO  Generated: js/tsconfig.json
INFO  Generated: js/arknights.js
INFO  Generated: js/pjax.js
INFO  Generated: 404.html
INFO  Generated: 2022/05/20/hello-world/index.html
INFO  17 files generated in 640 ms

搜索功能异常和使用方法请教

如题,主题版本已是最新
image
package.json依赖:

{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "6.0.0"
},
"dependencies": {
"hexo": "^6.0.0",
"hexo-blog-encrypt": "^3.1.6",
"hexo-browsersync": "^0.3.0",
"hexo-deployer-git": "^3.0.0",
"hexo-filter-mathjax": "^0.8.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-index": "^2.0.0",
"hexo-generator-searchdb": "^1.4.0",
"hexo-generator-tag": "^1.0.0",
"hexo-render-pug": "^2.1.4",
"hexo-renderer-marked": "^5.0.0",
"hexo-server": "^3.0.0"
},
"devDependencies": {
"hexo-renderer-dartsass": "^0.1.2",
"hexo-renderer-ts": "^1.3.0"
}
}

请教问题:
自定义的css是否支持本地引入,如果支持,怎么在主题配置文件中写入,下图是我的写法,直接报下图错误
image

image

斜体字体未使用jetbrains mono

如图
IMG_20220228_223911_285.JPG
使用英文也一样,所以应该不是中文的问题

顺带还想问一下为什么网页标题前面有个竖着的杠杠,_config.yml里面没有这东西啊 IMG_20220228_224043_325.JPG

脚注跳转链接出错

正常显示效果:

  • 点击蓝色脚注链接①可以跳转到②注释,再点③可以跳到①所在行
    Snipaste_2020-09-12_22-35-03.jpg

实际效果:

  • 点击蓝色脚注链接①会跳转到404页面,而且①处的链接指向(②处)应该是以#开头,跳转到页尾,但这里直接跳转到另一个页面了
    Snipaste_2020-09-12_22-42-10.jpg

Valine评论问题

npm: 8.1.2
node: 16.13.2
hexo: 6.0.0
hexo-cli: 4.3.0

使用此主题构建带Valine评论的网页时未出错
但在测试网页功能时Valine评论刷新后消失
有时候把网页后?t=1xxxxxxxxxx去除后在所有网页或部分网页显示同一个评论
Valine后台Comments有记录

{
  "nick": "Test",
  "ip": "2409:*********:f007",
  "updatedAt": "2022-02-09T00:30:51.390Z",
  "ACL": {
    "*": {
      "read": true
    }
  },
  "objectId": "62030**********83b49",
  "mail": "****************@gmail.com",
  "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/******* (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/******",
  "insertedAt": {
    "__type": "Date",
    "iso": "2022-02-09T00:30:49.910Z"
  },
  "createdAt": "2022-02-09T00:30:51.390Z",
  "link": "https://**************",
  "comment": "<p>test</p>\n",
  "url": "/",
  "QQAvatar": ""
}

附package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "6.0.0"
  },
  "dependencies": {
    "hexo": "^6.0.0",
    "hexo-browsersync": "^0.3.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-searchdb": "^1.4.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-dartsass": "^0.1.2",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^5.0.0",
    "hexo-renderer-pug": "^3.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3"
  }
}

Mermaid FAIL

Mermaid 反复提示语法错误,直接复制样例都挂了 QAQ

另外这个 Mermaid 没更新欸。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.