It is recommended to copy a copy of the hexo directory source folder for some magic changes and experimental functions to be added for experimentation.
You can use git backup, you can also take the simplest zip backup
The initial backup is recommended to be established based on basic availability
Create a modify.md file to record your modification records
hexo init namecreate corresponding name folder,hexo init create working path in current directory.
/path to your hexo/
node_modules
you modules here
_config.yml
the default configuration of your site
package.json
the information of installed package
scaffolds
template folder
When you create a new post,Hexo will base on scaffolds contents to create new post,for example:hexo new photo "My Gallery"
When you run the command,Hexo will try to search photo.md in scaffolds ,based on the content of photo.md to create your new post,here are some common objects of your new post:layout-布局,title-标题,date-文件建立日期
source
Used to store user resources,apart from _posts folder,Files/folders named starting with _ (underscore) and hidden files will be ignored.
_drafts
_posts
themes
Configuration
In _config.yml file to modify the most of you configuration。
hexo init - Create a hexo runtime framework in the current folder.
hexo init name - Create a new name folder in the current folder as the hexo running framework
hexo new layout "title" - Create a new post, if there is no layout, use the default layout (default is post).
hexo has three default layouts post/page/draft, you can specify the default layout by modifying the default_layout parameter in _config.yml.
* The page exists in the form of a folder, and the md file in the page folder is the rendering of the corresponding page.
* post/page/draft can be modified by entering Front-Matter in the Scaffold folder.
Custom other layouts are the same as post, and will be stored in the /scaffolds folder.
hexo new page -p about/me "About me" - Create a /source/about/me.md file, and the title in Front Matter is also “About me”
hexo generate - Generate static files, which can be abbreviated as hexo g
hexo deploy - Deploy the website, which can be abbreviated as hexo d
hexo server - Start the service locally
hexo clean - Clear cache and static files
hexo list <type> - List site information
Add waline to you site.
Add message board
hexo new page "messages" will generate a messages folder in \your root directory\source\, just modify index.md
Then add eomusic.pug in themes\butterfly\layout\page.pug.
Add and delete, + means increase, - means decrease, the following code mainly adds two lines for your own attention
The function is to introduce eomusic.pug layout when the type of the front-matter of the page is music.
block content #page - if top_img === false h1.page-title= page.title case page.type when 'tags' include includes/page/tags.pug when 'link' include includes/page/mylink.pug + //- 音乐页 + when 'music' + include includes/page/eomusic.pug
add css styles
Create a new music.css in your hexo root directory\node_modules\hexo-theme-butterfly\source\css, copy the following style and paste it in.
document.body.onmousedown = function(event) { if (event.button == 0) { var targ = event.target; var tname = targ.tagName; var tClassname = targ.classList[1]; var tidname = targ.id;
# 根目录执行以下命令 # npm install hexo-douban --save # 将下面的配置写入站点的配置文件 _config.yml douban: id:xxxx# 你的豆瓣ID builtin:false# 是否将hexo douban命令默认嵌入进hexo g、hexo s,使其自动执行hexo douban 命令。默认关闭。当豆瓣条目较多时,建议关闭。 item_per_page:10# 每页展示的条目数,默认 10 。 meta_max_line:4# 每个条目展示的详细信息的最大行数,超过该行数则会以 "..." 省略,默认 4 。 customize_layout:page# 自定义布局文件。默认值为 page 。 book: path:books/index.html# 生成页面后的路径,默认生成在 //yourblog/books/index.html 等下面。如需自定义路径,则可以修改这里。 title:'This is my book title'# title: 该页面的标题。 quote:'This is my book quote'# 写在页面开头的一段话,支持html语法。 option:# 该页面额外的 Front-matter 配置,参考Hexo 文档。无特别需要,留空即可。 movie: path:movies/index.html title:'This is my movie title' quote:'This is my movie quote' option: game: path:games/index.html title:'This is my game title' quote:'This is my game quote' option: song: path:songs/index.html title:'This is my song title' quote:'This is my song quote' option: timeout:10000
# 展示帮助文档 hexo douban -h Usage: hexo douban
Description: Generate pages from douban
Options: -b, --books Generate douban books only -g, --games Generate douban games only -m, --movies Generate douban movies only -s, --songs Generate douban songs only ## 安装了hexo douban之后,不能用hexo d,因为hexo douban跟hexo deploy 的前缀都是hexo d。
The official project README is relatively clear. After grabbing your id, configure the homepage. Before hexo douban, remember to hexo clean. There may be crawling failures, and you can grab it after a few more tries.
Choose the icon you need, put it in the library, and add it to the item in the shopping cart
On the project details page, click Font class, click no code yet, and click generate text. The website will automatically generate a CSS link, copy the corresponding link.
Inject css snippets in the theme configuration file inject>head
Fill in the icon where it needs to be used, such as Menu, and the format of the image is iconfont icon name.