academicpages没有系统性的官方文档, 我在diy的时候遇到了很多困难, 因此撰写了这个文档用以参考
- 项目源码: https://github.com/academicpages/academicpages.github.io
- 我的DIY版本: https://github.com/ICUlizhi/ICUlizhi.github.io
本章可以跳过
- _sass
- _site : 本地运行生成的网站文件,网络部署无需此文件夹
- assets : 核心代码
- talkmap
- _data
- _commets
- _authors.yml
- _navigation.yml
- _ui-text.yml
- _includes
- config.dev.yml
- config.yml : 核心的设置文件
- images : 放图片
- files : 放文件
- _draft,_talks,_teaching,_publications,_portfolio,_posts : 每个导航栏单独一个文件夹,存放markdown
- _pages : 页面内容,放markdown和html
- _layouts
- markdown_generatot : md生成器
使用github代理部署即可,想换域名也可以,网上都有教程,推荐一个校友的教程,和本项目是配套的 戳这里
- 必须用linux,在windows上配置是极为困难的
- academicpagesd的readme提供的环境配置很不仔细,遇到诸多版本问题,我使用了RVM调整ruby的版本,并手动加了一些包
sudo apt update
sudo apt install gnupg2
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install ruby
rvm docs generate-ri
rvm use ruby --default
装成功了belike:
bundle install
bundle add webrick faraday-retry
bundle exec jekyll liveserve
然后就可以在http://localhost:4000/看到我们的网站了,这个进程你不关闭它是不会停的,且会在运行中输出一些报错
- 请打开
_config.yml
- 这个文件里有大量个人信息, 建议从头开始改, 直到 author: 模块
- 注意照片文件用png, 放在image文件夹
- 在这个网站整一个,输出一个html对象,复制到 about.md 即可
- 在这个网站整一个,输出一个html对象,复制到对应页的 md 文件即可
以下代码块中的都需要添加, Repositories 可以根据需要修改为其他名称
Collections模块
Repositories:
output: true
permalink: /:collection/:path/
Defaults模块
- scope:
path: ""
type: Repositories
values:
layout: single
author_profile: true
share: true
comments: true
- title: "Repositories"
url: /Repositories/
这个文件需要自行添加,参考代码如下:
---
layout: archive
title: "Repositories"
permalink: /Repositories/
author_profile: true
---
{% include base_path %}
{% for post in site.Repositories reversed %}
{% include archive-single.html %}
{% endfor %}
该栏目下的md文件需要放在根目录下的_Repositories文件夹中, 请自行创建, 例如PKU-2024-IBAL-cracked-version.md
---
title: "PKU-2024-IBAL-cracked-version"
collection: Repositories
type: "Repositories"
permalink: /Repositories/PKU-2024-IBAL-cracked-version
venue: "Peking Univercity"
date: 2024-07-28
location: "Beijing, China"
---
英美文学概况的资料以及课程攻略,包含大模型写作业,给英文原著作摘要等功能
- 状态 : 完结,开源
- 链接 : [https://github.com/ICUlizhi/PKU-2024-IBAL-cracked-version](https://github.com/ICUlizhi/PKU-2024-IBAL-cracked-version)
以Notes页为例:
定义页面的元数据和布局信息
---
layout: archive
title: "Notes"
permalink: /Notes/
author_profile: true
---
{% include base_path %}
{% assign paths = "概论统计A(现为信概统).md,hjfpython.md" | split: "," %}
{% for post in site.Notes reversed %}
{% for path in paths %}
{% if post.path contains path %}
{% include archive-single.html %}
{% break %}
{% endif %}
{% endfor %}
这些md文件需要出现在根目录下_Notes文件夹中, 也可以直接遍历
其实就是Front Matter+自由发挥的markdown,可参考模版