Hexo搭建个人博客

  我当然是粉丝不能

<iframe frameborder=”no” border=”0” marginwidth=”0” marginheight=”0” width=330 height=86 src=”//music.163.com/outchain/player?type=2&id=209228&auto=1&height=66”></iframe>

<audio src="medias/http://www.kugou.com/song/fn2mv7e.html?frombaidu?frombaidu#hash=B7B5B38ECBAE006B2895C4298A0440DC&album_id=0" controls autoplay="autoplay"loop></audio> ## 正文:  大专理科 ## 配置环境 ### 玩儿拿货价格下载相应平台的最新版本,一路安装即可。 ### 是打发ioer ###肩宽多少功夫i ###问哦不都是法师 ### 王朝几节课 ### 撒谎表示发布v ### 奋不顾身 ### 发货 ``` 个人的建议 ``` ``` 的说法健康 .... 十多个放假 ``` ithubweb/),本地已经简单的设置好了,但是现在域名和服务器都是基于自己的电脑,接下来需要跟github进行关联。 ## 配置Github ### 建立Repository 建立与你用户名对应的仓库,仓库名必须为【your_user_name.github.io】,固定写法 然后建立关联,我的Blog在本地/Users/leopard/Blog,Blog是我之前建的东西也全在这里面,有: > Blog >  | >  |-- _config.yml >  |-- node_modules >  |-- public >  |-- source >  |-- db.json >  |-- package.json >  |-- scaffolds >  |-- themes           现在我们需要_config.yml文件,来建立关联,命令: vim _config.yml 翻到最下面,改成我这样子的,注意: `: 后面要有空格` deploy: type: git repository: https://github.com/leopardpan/leopardpan.github.io.git branch: master 执行如下命令才能使用git部署 npm install hexo-deployer-git --save 网上会有很多说法,有的type是github, 还有repository 最后面的后缀也不一样,是github.com.git,我也踩了很多坑,我现在的版本是hexo: 3.1.1,执行命令hexo -vsersion就出来了,貌似3.0后全部改成我上面这种格式了。 忘了说了,我没用SSH Keys如果你用了SSH Keys的话直接在github里复制SSH的就行了,总共就两种协议,相信你懂的。 然后,执行配置命令: hexo deploy  然后再浏览器中输入[http://leopardpan.github.io/](http://leopardpan.github.io/)就行了,我的 github 的账户叫 leopardpan ,把这个改成你 github 的账户名就行了 ### 部署步骤 每次部署的步骤,可按以下三步来进行。 hexo clean hexo generate hexo deploy 一些常用命令: hexo new "postName" #新建文章 hexo new page "pageName" #新建页面 hexo generate #生成静态页面至public目录 hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server) hexo deploy #将.deploy目录部署到GitHub hexo help #查看帮助 hexo version #查看Hexo的版本 这里有大量的[主题列表](https://github.com/hexojs/hexo/wiki/Themes)使用方法里面 都有详细的介绍,我就不多说了。 我这里有几款个人认为不错的主题,免去你们,一个一个的选了,欢迎吐槽我的审美,?  [Cover](https://github.com/daisygao/hexo-themes-cover) - A chic theme with facebook-like cover photo  [Oishi](https://github.com/henryhuang/oishi) - A white theme based on Landscape plus and Writing.  [Sidebar](https://github.com/hardywu/hexo-theme-sidebar) - Another theme based on Light with a simple sidebar  [TKL](https://github.com/SuperKieran/TKL) - A responsive design theme for Hexo. 一个设计优雅的响应式主题  [Tinnypp](https://github.com/levonlin/Tinnypp) - A clean, simple theme based on Tinny  [Writing](https://github.com/yunlzheng/hexo-themes-writing) - A small and simple hexo theme based on Light  [Yilia](https://github.com/litten/hexo-theme-yilia) - Responsive and simple style 优雅简洁响应式主题,我用得就是这个。  [Pacman voidy](https://github.com/Voidly/pacman) - A theme with dynamic tagcloud and dynamic snow ### 一些基本路径  文章在 source/_posts,编辑器可以用 Sublime,支持 markdown 语法。如果想修改头像可以直接在主题的 _config.yml 文件里面修改,友情链接,之类的都在这里,修改名字在 public/index.html 里修改,开始打理你的博客吧,有什么问题或者建议,都可以提出来,我会继续完善的。 Markdown语法参考链接: [作业部落](https://www.zybuluo.com/mdeditor) ### Q&A > 问:如何让文章想只显示一部分和一个 `阅读全文` 的按钮? > 答:在文章中加一个 `` , `` 后面的内容就不会显示出来了。

> 问:本地部署成功了,也能预览效果,但使用 username.github.io 访问,`出现 404 ` . > 答:首先确认 hexo d 命令执行是否报错,如果没有报错,再查看一下你的 github 的 username.github.io 仓库,你的博客是否已经成功提交了,你的 github 邮箱也要通过验证才行。

转载请注明原地址,潘柏信的博客:[http://leopardpan.github.io](http://leopardpan.github.io) 谢谢!

打赏一个呗

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦