网站首页 > 基础教程 正文
什么是hexo?
hexo出自台湾的@tommy351之手,一个基于Node.js的静态博客程序,可以很方便的生成静态网页托管于github、gitcafe和Heroku,类似于jekyll,但Jekyll需要的git命令稍有点繁琐。
为什么要用hexo?
引用下作者的话:
不可思议的快速 ─ 只要一眨眼静态文件即生成完成
支持 Markdown语法
仅需一道指令即可部署到 GitHub Pages 和 Heroku
已移植 Octopress 插件
高扩展性、自订性
兼容于 Windows, Mac & Linux
前期准备(以下全部针对Windows用户):
1.搭建Node.js环境 (参考文章:在Windows下搭建nodejs环境以及配置npm)
2.注册github账号并如何配置(参考文章:github入门教程 — Windows平台下如何将项目华丽的提交到Github上)
等以上操作完成后,然后创建项目:
项目名:username.github.io
安装hexo,打开cmd命令(记得配置node.js环境变量)
npm install hexo -g
初始化Hexo
mkdir blog
cd blog
hexo init
npm install
hexo server
你的Hexo就在本地部署好了,浏览器输入 http://localhost:4000 就可以看到效果。
如何部署到github上,并且以username.github.io的形式访问?
编辑_config.yml,修改成你的email和username,保存。
如果你是为一个项目制作网站,那么需要把_config.yml里的branch设置为gh-pages 另外,编辑_config.yml文件时,注意空格。
通过Git Bush,执行下列指令即可完成部署。
hexo generate #生成静态页面,会在public 目录下生成一系列html,css等文件。
hexo deploy
hexo deploy时出现Error: spawn ENOENT的解决方案:
如果你安装msysgit客户端,一路默认安装,在cmd中执行hexo deploy时,会出现Error: spawn ENOENT,切记这步用Git Bush,cd到blog文件夹下执行以上命令。
待续...
- 上一篇: Android动态调试(1)-Radare2和lldb
- 下一篇: NPM 使用介绍
猜你喜欢
- 2024-11-25 Deno 1.30 正式发布
- 2024-11-25 用 WasmEdge 和 Rust 在边缘云上构建高性能且安全的微服务
- 2024-11-25 通过浏览器工作台启动本地项目
- 2024-11-25 r2frida:基于Frida的远程进程安全检测和通信工具
- 2024-11-25 NPM 使用介绍
- 2024-11-25 Android动态调试(1)-Radare2和lldb
- 2024-11-25 Metasploit渗透测试之MSFvenom
- 2024-11-25 浅析CTF中的Node.js原型链污染
- 2024-11-25 首个SSRF漏洞开篇学习
- 2024-11-25 github webhook自动化部署
- 06-09Socioeconomic growth goals high on meetings' agenda
- 06-09Cities Along Middle Reaches of Yangtze River Agree on 63 Cooperation Items
- 06-09Scientists to make flag flutter on moon
- 06-09CBN丨Foreign-funded institutions bullish on Chinese assets
- 06-09Full Text: Joint Statement between the People's Republic of China and the French Republic on Climate Change on the occasion of the Tenth Anniversary of the Paris Agreement
- 06-092022年底总结,温暖和激励自己的文案
- 06-09百度实时推送代码解决方案(百度实时推送工具)
- 06-09PHP漏洞之跨网站请求伪造(php跨站脚本攻击)
- 最近发表
-
- Socioeconomic growth goals high on meetings' agenda
- Cities Along Middle Reaches of Yangtze River Agree on 63 Cooperation Items
- Scientists to make flag flutter on moon
- CBN丨Foreign-funded institutions bullish on Chinese assets
- Full Text: Joint Statement between the People's Republic of China and the French Republic on Climate Change on the occasion of the Tenth Anniversary of the Paris Agreement
- 2022年底总结,温暖和激励自己的文案
- 百度实时推送代码解决方案(百度实时推送工具)
- PHP漏洞之跨网站请求伪造(php跨站脚本攻击)
- ThinkPHP后台入口地址查找(thinkphp build.php)
- PHP新手如何提高代码质量(php新手如何提高代码质量的方法)
- 标签列表
-
- jsp (69)
- gitpush (78)
- gitreset (66)
- python字典 (67)
- dockercp (63)
- gitclone命令 (63)
- dockersave (62)
- linux命令大全 (65)
- pythonif (86)
- location.href (69)
- dockerexec (65)
- tail-f (79)
- queryselectorall (63)
- location.search (79)
- bootstrap教程 (74)
- deletesql (62)
- linuxgzip (68)
- 字符串连接 (73)
- html标签 (69)
- c++初始化列表 (64)
- mysqlinnodbmyisam区别 (63)
- arraylistadd (66)
- mysqldatesub函数 (63)
- window10java环境变量设置 (66)
- c++虚函数和纯虚函数的区别 (66)