0%

Hexo-Academia 配置

准备工作

  • 一个已经搭建在Github Pages上的Hexo网站

    如果没有的话可以按照这个链接里进行搭建。

  • git 和 npm

安装

下载配置文件。

1
git clone https://github.com/PhosphorW/hexo-theme-academia.git themes/Academia

下载需要的插件。

1
npm install hexo-renderer-pug hexo-renderer-stylus

在项目的 _config.yml 中找到 theme 一栏并进行更改。

1
npm install hexo-renderer-pug hexo-renderer-stylus

##主题配置

打开 themes 的 _config.yml(注意不是 hexo project 的 _config.yml )

1
open _config.yml

个人信息配置。

1
2
3
4
author: #个人姓名
author_bio: #个人简介
avatar: /img/avatar.jpg #个人头像 默认是小灰人 可以通过在/themes/Academia/source/img/avatar.jpg 替换添加
# if author sets in hexo_config, this string doesn't work

顶部菜单栏设置,默认提供 Publications,About 和 Blog,可以页内跳转也可以添加外链

1
2
3
4
menu:
Publications: /#Publications #页内跳转
About: /
Blog: https://phower.me #添加外链

添加社交信息,附带小图标,不需要的或不想展示的可以注释掉,或者直接关掉。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
social:
enable: true #不想展示可以关掉
social_links:
fab fa-twitter: /
fab fa-facebook-square: /
fab fa-github: /
fab fa-stack-overflow: /
fab fa-linkedin: /
fab fa-weibo: /
fab fa-weixin: /
fab fa-qq: /
fas fa-envelope: / #E-mail
fas fa-rss: / #rss

e_social:
enable: true #额外社交链接
e_social_links:
Google Scholar: / || fas fa-graduation-cap
ORCID: / || fab fa-orcid

可以添加个人简历,可以通过在/themes/Academia/source/attaches/CV.pdf 替换添加。

1
2
3
4
cv_dl:
enable: true
dir: /attaches/CV.pdf
description: My Detail CV.

编辑主页

新建文章。

1
hexo n post "any title"

去到 hexo project 的/source/_posts 中就能找到名称相同的 markdown 文档,里面有几行内容。

1
2
3
4
5
---
title: Public #标题
date: 2020-09-07 15:45:51 #创建日期
tags: #标签 在 Academia 风格下不提供标签 所以无效
---

在文首加上 academia: true,才会被 academia 显示出来。

1
2
3
4
5
6
---
title: Public #标题
date: 2020-09-07 15:45:51 #创建日期
tags: #标签 在 Academia 风格下不提供标签 所以无效
academia: true
---

然后就可以在上面写想写的内容啦。

1
2
3
4
5
6
7
8
---
title: Public #标题
date: 2020-09-07 15:45:51 #创建日期
tags: #标签 在 Academia 风格下不提供标签 所以无效
academia: true
---

在这里用 markdown 语法写任意想写的内容。

编辑其他页

我这里以 Publications 页为例。现在只在标题栏中有 Publications,但是实际后段文档中并没有,所以我们需要先添加一下。

1
hexo n post "Publications"  

然后系统就会在/source 里新增一个同名文件夹,同时文件夹里有一个 index.md. 直接打开然后和之前一样编辑就好啦。

1
2
cd /source/Publications
open index.md

编辑完成之后要在 Academia 的 _config.yml 文件中链接一下。

1
2
menu:
Publications: /Publications