RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
使用Hexo开源博客系统,轻松搭建你的个人博客(1)

Hexo 是一个轻量级、简洁、高效且高端的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。同时有着丰富的主题,官网或者GitHub都可以轻松下载到。由于Hexo博客都是静态文件,所以推荐部署在Github上,不需要额外的服务器和后台,做到零成本。
话不多说,下面就开始介绍如何使用Hexo搭建个人博客。
博客原文链接:https://codernice.top/articles/65209.html

成都创新互联公司是专业的进贤网站建设公司,进贤接单;提供成都做网站、网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行进贤网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

准备

hexo依赖于Node.js和Git,因此需要先安装这两项:
1.Node.js下载地址
2.Git下载地址
安装完Node.js后,可使用npm命令,由于npm命令本身是很慢的(源在国外),建议使用淘宝的cnpm来替代npm命令,打开命令行执行如下命令安装cnpm:

npm install -g cnpm --registry=https://registry.npm.taobao.org

-g表示全局安装,下面就可以开始安装Hexo了。

安装Hexo

1.安装

命令行执行如下命令:

cnpm install -g hexo

2.创建目录

在任意地方创建文件夹hexo,如D:\blog\hexo,这个文件夹就是用来存放博客代码和文章的地方,后面我们称之为根目录。

3.初始化Hexo

这边建议在GitBash操作,又键该目录,选择Git Bash Here,打开后执行如下命令:

hexo init

初始化后会在目录生成如下文件
使用Hexo开源博客系统,轻松搭建你的个人博客(1)
大家会看到,目录中有个名为_config.yml的文件,这个是全局配置文件,主要配置站点信息。
这时我们的hexo博客已安装完成,执行如下命令

hexo g
hexo s

然后打开浏览器输入:http://localhost:4000,即可看到博客主页。
使用Hexo开源博客系统,轻松搭建你的个人博客(1)

4.写文章

执行下列命令来创建一篇新文章

hexo new [layout] </code></pre><p>layout可选,默认post,可以通过修改 _config.yml 中的 default_layout 参数来指定默认布局</p><p>Hexo 有三种默认布局:post、page 和 draft。在创建者三种不同类型的文件时,它们将会被保存到不同的路径;而自定义的其他布局和 post 相同,都将储存到 source/_posts 文件夹。</p><table>
<thead>
<tr>
<th>布局</th><th>路径</th></tr>
</thead><tbody><tr>
<td>post</td>
<td>source/_posts</td>
</tr>
<tr>
<td>page</td>
<td>source</td>
</tr>
<tr>
<td>draft</td>
<td>source/_drafts</td>
</tr>
</tbody>
</table><p>执行命令后会在对应目录下生成一个markdown文件</p><p><img src="/upload/otherpic63/13855902-4fdc46428a0ba7a1.png" alt="使用Hexo开源博客系统,轻松搭建你的个人博客(1)"></p><h2>总结</h2><p>在此,Hexo博客初始版本已经搭建完成,下一章节,将教大家如何安装主题,配置一些常用的功能。</p><h3>重点</h3><p><code>hexo init</code>:初始化Hexo<br/><code>hexo g</code>:重新生成public文件夹,这个里面是生成的所有静态文件,包括html,css,js文件以及图片等<br/><code>hexo s</code>:启动hexo服务的<br/>可连着使用<code>hexo s hexo g</code><br/><code>hexo new [layout] <title></code>:创建文章</p>            
            
            <br>
分享名称:使用Hexo开源博客系统,轻松搭建你的个人博客(1)<br>
链接分享:<a href="http://aqpgk.com/article/jgdsei.html">http://aqpgk.com/article/jgdsei.html</a>
</div>
<div class="hot_new">
<div class="page_title clearfix">
<h3>其他资讯</h3>
</div>
<div class="news_list clearfix">
<ul>
<li>
<a href="/article/ddscho.html">PHP性能优化的方法合集-创新互联</a>
</li><li>
<a href="/article/ddssds.html">用Python做数据科学时容易忘记的八个要点分别是什么-创新互联</a>
</li><li>
<a href="/article/ddschc.html">Linux怎么恢复误删内容-创新互联</a>
</li><li>
<a href="/article/ddschg.html">Android中如何解决ListView与getView调用卡顿问题-创新互联</a>
</li><li>
<a href="/article/ddssci.html">Gateway-创新互联</a>
</li></ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 底部信息 -->
<div class="footer wow fadeInUp">
<div class="rowFluid">
<div class="span12">
<div class="container">
<div class="footer_content">
<div class="span4 col-xm-12">
<div class="footer_list">
<div class="span6">
<div class="bottom_logo"><img src="/Public/Home/images/ewm.jpg" alt="微信服务号二维码" /></div>
</div>
<div class="span6 col-xm-12">
<div class="quick_navigation">
<div class="quick_navigation_title">快速导航</div>
<ul>
<li><a href="http://www.yuzhoubg.com/" title="yuzhoubg.com" target="_blank">yuzhoubg.com</a></li><li><a href="http://www.cdhdyh.com/" title="成都柴油发电机" target="_blank">成都柴油发电机</a></li><li><a href="https://www.cdcxhl.com/douyin/" title="短视频拍摄" target="_blank">短视频拍摄</a></li><li><a href="http://www.meishanidc.com/" title="眉山IDC托管" target="_blank">眉山IDC托管</a></li><li><a href="http://www.hmvxp.com/" title="成都公司注销" target="_blank">成都公司注销</a></li><li><a href="http://www.cetxf.com/" title="成都企业网站设计" target="_blank">成都企业网站设计</a></li><li><a href="https://www.cdxwcx.com/jifang/yaan.html" title="雅安移动机房" target="_blank">雅安移动机房</a></li></ul>
</div>
</div>
</div>
</div>
<div class="span4 col-xm-6 col-xs-12">
<div class="footer_list">
<div class="footer_link">
<div class="footer_link_title">友情链接</div>
<ul id="frientLinks">
<a href="https://www.cdcxhl.com/" title="网站制作" target="_blank">网站制作</a>
<a href="https://www.cdcxhl.com/" title="网站建设" target="_blank">网站建设</a>
<a href="https://www.cdxwcx.com/tuiguang/" title="成都网络推广" target="_blank">网络推广</a>
<a href="http://seo.cdkjz.cn/" title="成都网站推广" target="_blank">网站推广</a>
<a href="https://www.cdcxhl.com/xiaochengx.html" title="成都微信小程序开发" target="_blank">小程序开发</a>
<a href="https://www.cdcxhl.com/menu.html" title="创新互联网站栏目导航" target="_blank">网站导航</a>
</ul>
<div class="footer_link_title">网站建设</div>
<ul id="frientLinks">
<li><a href="/">宜宾勤盛利枫建站</a></li>
<li><a href="https://www.cdcxhl.com/menu.html" title="创新互联网站栏目导航" target="_blank">网站导航</a></li>
</ul>
</div>
</div>
</div>
<div class="span4 col-xm-6 col-xs-12">
<div class="footer_list">
<div class="footer_cotact">
<div class="footer_cotact_title">联系方式</div>
<ul>
<li><span class="footer_cotact_type">企业:</span><span class="footer_cotact_content">四川勤盛利枫机电有限公司   </span></li>
<li><span class="footer_cotact_type">地址:</span><span class="footer_cotact_content">成都市青羊区太升南路288号</span></li>
<li><span class="footer_cotact_type">电话:</span><span class="footer_cotact_content"><a href="tel:18980820575" class="call">18980820575</a></span></li>
<li><span class="footer_cotact_type">网址:</span><span class="footer_cotact_content"><a href="/" title="宜宾网站建设">www.aqpgk.com</a></span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="copyright">
<p>公司名称:四川勤盛利枫机电有限公司   联系电话:18980820575</p>
<p><a href="http://beian.miit.gov.cn" target="_blank" rel="nofollow">网站备案号:蜀ICP备2025168279号-11</a></p>
<p>宜宾勤盛利枫建站 宜宾网站建设 宜宾网站设计 宜宾网站制作 <a href="http://www.cdxwcx.cn/" target="_blank">成都做网站</a></p>
</div>
</div>
</div>
</div>
</body>
</html>
<script>
$(".technical_support_box_z_info_box img").each(function(){
var src = $(this).attr("src");    //获取图片地址
var str=new RegExp("http");
var result=str.test(src);
if(result==false){
var url = "https://www.cdcxhl.com"+src;    //绝对路径
$(this).attr("src",url);
}
});
window.onload=function(){
document.oncontextmenu=function(){
return false;
}
}
</script>