{ "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": "
安装 nodejs
\n安装 git
\n安装 hexo(windows 需进入 git bash)
\nnpm install -g hexo-cli
初始化博客目录
\nhexo init blog
进入博客目录
\ncd blog
初始化 hexo 到博客目录
\nnpm install
下载主题
\ngit clone
https://github.com/amehime/hexo-theme-shoka.git ./themes/shoka
卸载 hexo-renderer-marked 以及别的 markdown 文件渲染器
\nnpm un hexo-renderer-marked --save
安装(md 文件渲染器,压缩 css/js/html)
\nnpm i hexo-renderer-multi-markdown-it --save
安装(给生成的 css 文件们添加浏览器前缀)
\nnpm i hexo-autoprefixer --save
安装(站内搜索功能)
\nnpm i hexo-algoliasearch --save
安装(文章或站点字数及阅读时间统计)
\nnpm i hexo-symbols-count-time --save
安装(生成 Feed 文件)
\nnpm i hexo-feed --save
清除静态文件
\nhexo clean
生成静态文件
\nhexo g
安装 git 推送插件
\nnpm install hexo-deployer-git --save
推送静态文件到 git
\nhexo d
npm install hexo-admin --save
hexo-admin 编辑 url
\n\nsettings 设置用户名、密码、Secret
\n\n把底部生成的配置拷入 hexo 配合文件中 (_config.yml)
\nadmin: | |
username: username | |
password_hash: xxxxxx | |
secret: 'my super secret phrase' #用单引号包裹 | |
deployCommand: 'hexo-publish.sh' #windows 用 hexo-publish.bat,linux 用 hexo_publish.sh |
#!/bin/bash | |
hexo clean | |
hexo g | |
hexo d |
@echo off | |
cd D:\\blog | |
d: | |
@cmd /c \"hexo clean&& hexo g&&hexo d&&echo success\" |
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$ hexo new \"My New Post\" |
More info: Writing
\n$ hexo server |
More info: Server
\n$ hexo generate |
More info: Generating
\n$ hexo deploy |
More info: Deployment
\n", "tags": [] } ] }