{ "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
    \n
  1. \n

    安装 nodejs

    \n
  2. \n
  3. \n

    安装 git

    \n
  4. \n
  5. \n

    安装 hexo(windows 需进入 git bash)

    \n

    npm install -g hexo-cli

    \n
  6. \n
  7. \n

    初始化博客目录

    \n

    hexo init blog

    \n
  8. \n
  9. \n

    进入博客目录

    \n

    cd blog

    \n
  10. \n
  11. \n

    初始化 hexo 到博客目录

    \n

    npm install

    \n
  12. \n
\n

# shoka 主题安装

\n
    \n
  1. \n

    下载主题

    \n

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

    \n
  2. \n
  3. \n

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

    \n

    npm un hexo-renderer-marked --save

    \n
  4. \n
  5. \n

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

    \n

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

    \n
  6. \n
  7. \n

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

    \n

    npm i hexo-autoprefixer --save

    \n
  8. \n
  9. \n

    安装(站内搜索功能)

    \n

    npm i hexo-algoliasearch --save

    \n
  10. \n
  11. \n

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

    \n

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

    \n
  12. \n
  13. \n

    安装(生成 Feed 文件)

    \n

    npm i hexo-feed --save

    \n
  14. \n
\n

# Hexo 部分常用命令

\n\n

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

\n\n
admin:
username: username
password_hash: xxxxxx
secret: 'my super secret phrase' #用单引号包裹
deployCommand: 'hexo-publish.sh' #windows 用 hexo-publish.bat,linux 用 hexo-publish.sh

# hexo-publish.sh

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

# hexo-publish.bat

\n
@echo off
cd D:\\blog
d:
@cmd /c \"hexo clean&& hexo g&&hexo d&&echo success\"
", "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": [] } ] }