{ "version": "https://jsonfeed.org/version/1", "title": "Hito的公告栏", "subtitle": "天下事有难易乎?为之,则难者亦易矣", "icon": "https://blog.jingxiyuan.cn/images/favicon.ico", "description": "hito的博客", "home_page_url": "https://blog.jingxiyuan.cn", "items": [ { "id": "https://blog.jingxiyuan.cn/2022/09/14/Hexo%E5%AE%89%E8%A3%85%E6%91%B8%E7%B4%A2/", "url": "https://blog.jingxiyuan.cn/2022/09/14/Hexo%E5%AE%89%E8%A3%85%E6%91%B8%E7%B4%A2/", "title": "Hexo安装摸索", "date_published": "2022-09-14T04:23:55.000Z", "content_html": "

# hexo 博客安装

\n

安装 nodejs

\n

安装 git

\n

安装 hexo(windows 需进入 git bash)

\n

npm install -g hexo-cli

\n

初始化博客目录

\n

hexo init blog

\n

进入博客目录

\n

cd blog

\n

初始化 hexo 到博客目录

\n

npm install

\n

# shoka 主题安装

\n

下载主题

\n

git clone https://github.com/amehime/hexo-theme-shoka.git ./themes/shoka

\n

卸载 hexo-renderer-marked 以及别的 markdown 文件渲染器

\n

npm un hexo-renderer-marked --save

\n

安装(md 文件渲染器,压缩 css/js/html)

\n

npm i hexo-renderer-multi-markdown-it --save

\n

安装(给生成的 css 文件们添加浏览器前缀)

\n

npm i hexo-autoprefixer --save

\n

安装(站内搜索功能)

\n

npm i hexo-algoliasearch --save

\n

安装(文章或站点字数及阅读时间统计)

\n

npm i hexo-symbols-count-time --save

\n

安装(生成 Feed 文件)

\n

npm i hexo-feed --save

\n

# Hexo 部分常用命令

\n

清除静态文件

\n

hexo clean

\n

生成静态文件

\n

hexo g

\n

安装 git 推送插件

\n

npm install hexo-deployer-git --save

\n

推送静态文件到 git

\n

hexo d

\n

# 安装 hexo-admin(编写博客插件)

\n

npm install hexo-admin --save

\n

hexo-admin 编辑 url

\n

http://localhost:4000/admin

\n

settings 设置用户名、密码、Secret

\n

http://localhost:4000/admin/#/settings

\n

把底部生成的配置拷入 hexo 配合文件中 (_config.yml)
\n admin: username: username password_hash: ````10$L.XAIqIWgTc5S1zpvV3MEu7/rH34p4Is/nq824smv8EZ3lIPCp1su secret: 'my super secret phrase' #用单引号包裹 deployCommand: 'hexo-publish.sh' #windows用hexo-publish.bat,linux用hexo-publish.sh

\n

# hexo-publish.sh

\n

#!/usr/bin/env sh hexo clean hexo g hexo d

\n

# hexo-publish.bat

\n

@echo off cd D:\\blog d: @cmd /c "hexo clean&& hexo g&&hexo d&&echo success"

\n", "tags": [] }, { "id": "https://blog.jingxiyuan.cn/2022/09/13/hello-world/", "url": "https://blog.jingxiyuan.cn/2022/09/13/hello-world/", "title": "Hello World", "date_published": "2022-09-13T00:03:19.511Z", "content_html": "

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

\n

# Quick Start

\n

# Create a new post

\n
h
$ hexo new \"My New Post\"

More info: Writing

\n

# Run server

\n
h
$ hexo server

More info: Server

\n

# Generate static files

\n
h
$ hexo generate

More info: Generating

\n

# Deploy to remote sites

\n
h
$ hexo deploy

More info: Deployment

\n", "tags": [] } ] }