Hexo-Theme-Acrylic-Next 项目使用教程
1. 项目的目录结构及介绍
Hexo-Theme-Acrylic-Next 项目的目录结构如下:
Hexo-Theme-Acrylic-Next/
├── layout/
├── scripts/
├── source/
├── LICENSE
├── README.md
├── _config.yml
└── package.json
目录介绍:
- layout/: 存放主题的模板文件,这些文件定义了网站的布局和结构。
- scripts/: 存放自定义脚本文件,用于扩展主题功能。
- source/: 存放静态资源文件,如CSS、JavaScript、图片等。
- LICENSE: 项目的许可证文件。
- README.md: 项目的说明文档。
- _config.yml: 主题的配置文件。
- package.json: 项目的依赖和脚本配置文件。
2. 项目的启动文件介绍
Hexo-Theme-Acrylic-Next 项目的启动文件主要是 _config.yml
和 package.json
。
_config.yml
这是主题的主要配置文件,包含了主题的各种设置,如网站标题、描述、导航菜单、侧边栏等。
package.json
这个文件定义了项目的依赖和脚本。通过运行 npm install
可以安装所有依赖,通过运行 npm run
可以执行定义的脚本。
3. 项目的配置文件介绍
_config.yml
_config.yml
文件是 Hexo-Theme-Acrylic-Next 的核心配置文件,包含了以下几个主要部分:
- 站点配置: 包括网站的标题、副标题、描述、作者等信息。
- 主题配置: 包括主题的各种设置,如导航菜单、侧边栏、社交链接等。
- 插件配置: 如果有使用插件,相关的配置也会在这里。
示例配置:
# Site
title: 我的博客
subtitle: ''
description: ''
author: 你的名字
language: zh-CN
timezone: ''
# URL
## If your site is put in a subdirectory, set url as 'http://example.com/child' and root as '/child/'
url: http://example.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
# 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
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
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:
# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format by specifying one of the formats in moment.js
date_format: YYYY-MM-DD
time_format: HH:mm:ss
# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: Acrylic
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: ''
通过修改 _config.yml
文件,可以自定义你的博客的各种设置。
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考