<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Hao Yin Blog</title>
  <subtitle>记录生活，分享感动</subtitle>
  <link href="/atom.xml" rel="self"/>
  
  <link href="http://569258yin.github.io/"/>
  <updated>2016-11-23T13:31:39.594Z</updated>
  <id>http://569258yin.github.io/</id>
  
  <author>
    <name>Hao Yin</name>
    
  </author>
  
  <generator uri="http://hexo.io/">Hexo</generator>
  
  <entry>
    <title>Hexo搭建博客小白教程</title>
    <link href="http://569258yin.github.io/2016/11/22/Hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2%E5%B0%8F%E7%99%BD%E6%95%99%E7%A8%8B/"/>
    <id>http://569258yin.github.io/2016/11/22/Hexo搭建博客小白教程/</id>
    <published>2016-11-21T23:44:12.000Z</published>
    <updated>2016-11-23T13:31:39.594Z</updated>
    
    <content type="html"><![CDATA[<h3 id="前言·"><a href="#前言·" class="headerlink" title="前言·"></a>前言·</h3><p>利用hexo在Github上搭建个人博客是我从我对象那里知道的，她学的前端，我学的Java，一直没了解过这个东西，前几天发现了，果断喜欢上了，以前都是在CSDN上写博客。<br>然后，我就开始了研究，到了现在，终于好了，网上教程确实很多啊，但是其间也有一些问题，然后昨天，我女朋友问了几个问题(女友还是小白啊，毕竟妹子)，在添加主题的地方。<br>比如：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"></div><div class="line">git clone http:.......git themes/icuals</div><div class="line">cd themes/icuals</div><div class="line">git pull</div></pre></td></tr></table></figure></p>
<p>这样我们觉得很简单的，对于刚学的妹子来说确实是一个挑战啊！！对于Lunix命令基本不懂得啊.So，我就写了这篇博客给我女友看，是不是很有爱的啊。</p>
<h3 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h3><p>先放我看过的教程，都可以提供参考的。<br><a href="https://www.zhihu.com/question/21193762" target="_blank" rel="external">使用hexo，如果换了电脑怎么更新博客？</a><br><a href="https://jayzangwill.github.io/blog/2016/07/31/hexo-github%E5%BF%AB%E9%80%9F%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/#more" target="_blank" rel="external">hexo+github快速搭建个人博客</a></p>
<h3 id="Github项目创建"><a href="#Github项目创建" class="headerlink" title="Github项目创建"></a>Github项目创建</h3><ul>
<li><p>1.注册Github账号<br><a href="https://github.com/" target="_blank" rel="external">Github官网</a></p>
<img src="/2016/11/22/Hexo搭建博客小白教程/github_sign_up.png" alt="[注册账号]" title="[注册账号]">
<p>点击上图的<strong> sign up </strong><br>然后就进入下图填写个人注册信息的界面，上面还有总步骤说明</p>
<img src="/2016/11/22/Hexo搭建博客小白教程/github_signup_info.png" alt="[注册账号详情]" title="[注册账号详情]">
<p>然后把三个步骤走完就OK啦！这时候你就拥有了你的Github账号和远程仓库。</p>
</li>
<li><p>2.创建项目<br>在你登录过的Github界面，右上方找到一个 <strong>+</strong> 号，然后点击，再选择new repository,就是新建项目啦。</p>
<img src="/2016/11/22/Hexo搭建博客小白教程/20161122214120.png" alt="[创建项目引导]" title="[创建项目引导]">
<p>然后就是新建项目界面，输入你要新建的项目名称，这里我们要建一个博客，所有名字要为你的Github账号加上<strong>.github.io</strong><br>比如我的Github账号为<strong>569258yin</strong>，那我创建的项目名称就为<strong>569258yin.github.io</strong>,下图可以看到我的项目名称已经存在了。</p>
<img src="/2016/11/22/Hexo搭建博客小白教程/20161122214451.png" alt="[]" title="[]">
<p>然后描述内容可以不写，或者写…（<em>对了，免费版的Github账号都是public的，也就是你的项目被人都可以看到，但是别人是没有权利修改的</em>）</p>
</li>
<li><p>3.创建分支</p>
<pre><code>创建分支为了我们能够在不同的电脑上方便修改博客，首先，Github上master主分支存放
的是hexo将我们的源文件转化生成的静态网页，是不存储我们实际操作的源文件的，我刚开
始也不知道，然后去了公司，从Github上克隆了我的项目，准备做修改呢，结果全是静态网
页，并不能直接修改，所有参考了知乎上大神给的方法。
</code></pre><p>  <strong> 项目分为两个分支：master主分支用了存放静态网页，hexo(名字随意)分支用了存放项目源文件 </strong></p>
</li>
</ul>
<p>当刚创好分支，如果你还没添加任何描述，项目界面是这样的<br><br>如果你的也是，就点图中红色标注的<strong>README</strong>，然后就可以添加一些描述啦。这里可以简单写一句话，关于如何使用README，可另行百度。<br>如果你的界面是下面的这种，那就可以直接点<strong>Branch:master</strong>,(<em>branch的意思就是分支,master代表主分支</em>)，在文本框中输入hexo（分支名）<br>然后点击create branch:hexo就可以了。<br><img src="/2016/11/22/Hexo搭建博客小白教程/20161123080021.png" alt="[]" title="[]"></p>
<ul>
<li>4.设置hexo分支为默认分支<br>点击项目设置,进到如下界面<img src="/2016/11/22/Hexo搭建博客小白教程/20161123205751.png" alt="[]" title="[]">
然后再选择Branch设置，可以看到当前默认分支为master，点击选择我们创建的hexo，然后点击右边update就可以了<img src="/2016/11/22/Hexo搭建博客小白教程/20161123205923.png" alt="[]" title="[]">
</li>
</ul>
<h3 id="本地搭建Hexo博客"><a href="#本地搭建Hexo博客" class="headerlink" title="本地搭建Hexo博客"></a>本地搭建Hexo博客</h3><ul>
<li>1.在本地创建一个文件夹，比如我的取名为hexo，然后鼠标右键git branch，调出git控制台工具。如果你还没有装过这个软件，<br>那就需要先安装<a href="https://git-for-windows.github.io" target="_blank" rel="external">软件下载地址</a>,不会安装的同学可以参考<br><a href="http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137396287703354d8c6c01c904c7d9ff056ae23da865a000" target="_blank" rel="external">廖雪峰的Git安装教程及使用说明</a><br>打开控制台后输入</li>
</ul>
<p><code>git clone https://github.com/569258yin/test.github.io.git</code></p>
<p>克隆你在Github创建的项目到本地，后面的网址是我的，你的项目网址在Github网站项目可以查看到，如下图：<br><img src="/2016/11/22/Hexo搭建博客小白教程/20161123210805.png" alt="[]" title="[]"><br>克隆完成后就会在hexo生成对应的项目文件夹<br><img src="/2016/11/22/Hexo搭建博客小白教程/20161123210936.png" alt="[]" title="[]"></p>
<ul>
<li>2.安装Node.js</li>
</ul>
<p>下载地址：<a href="https://nodejs.org/en/" target="_blank" rel="external">Node官网</a>，下载任意版本，安装就可以了，这个很简单。安装完成可以在git bash控制台输入 <strong>node -v </strong> 如果能显示版本号就说明安装成功！</p>
<ul>
<li>3.安装hexo插件</li>
</ul>
<p>在git bash中利用node 自带的包管理器进行安装：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">输入 npm install -g hexo(或者npm i -g hexo)</div></pre></td></tr></table></figure>
<ul>
<li>4.初始化hexo</li>
</ul>
<p>首先需要将git bash 当前文件路径选到你的项目根目录下，不会命令的可以直接将当前的git bash关掉，然后直接鼠标点进去项目文件夹，鼠标右键选择 git bash 就可以了<br>然后执行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo init</div></pre></td></tr></table></figure>
<p>这一步，我只能说超级慢的啊，视网络情况，反正我是等了很久…….</p>
<ul>
<li>5.测试是否安装完毕</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">输入  hexo generate(或 hexo g)</div></pre></td></tr></table></figure>
<p>初始化本地文件，这时候hexo会把我们的源文件转化为静态网页，</p>
<p>然后</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">输入  hexo server(或 hexo s)</div></pre></td></tr></table></figure>
<img src="/2016/11/22/Hexo搭建博客小白教程/20161123213034.png" alt="[]" title="[]">
<p>意思是在本地创建一个服务器用了展示我们生成的网页，这一步是非常方便的，以后我们有任何修改只需在本地查看，确保正确后再发布到github上。</p>
<p>之后打开你电脑上的浏览器，输入http:\localhost:4000访问，能显示就说明大功告成啦，安装完毕！！！</p>
<h3 id="将本地项目源文件上传到Github上"><a href="#将本地项目源文件上传到Github上" class="headerlink" title="将本地项目源文件上传到Github上"></a>将本地项目源文件上传到Github上</h3>]]></content>
    
    <summary type="html">
    
      &lt;h3 id=&quot;前言·&quot;&gt;&lt;a href=&quot;#前言·&quot; class=&quot;headerlink&quot; title=&quot;前言·&quot;&gt;&lt;/a&gt;前言·&lt;/h3&gt;&lt;p&gt;利用hexo在Github上搭建个人博客是我从我对象那里知道的，她学的前端，我学的Java，一直没了解过这个东西，前几天发现了，果断
    
    </summary>
    
      <category term="Hexo" scheme="http://569258yin.github.io/categories/Hexo/"/>
    
    
      <category term="hexo" scheme="http://569258yin.github.io/tags/hexo/"/>
    
  </entry>
  
  <entry>
    <title>Hello World</title>
    <link href="http://569258yin.github.io/2016/11/21/hello-world/"/>
    <id>http://569258yin.github.io/2016/11/21/hello-world/</id>
    <published>2016-11-21T13:56:29.614Z</published>
    <updated>2016-11-21T13:56:29.616Z</updated>
    
    <content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="external">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="external">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="external">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="external">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo new <span class="string">"My New Post"</span></div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="external">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo server</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="external">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo generate</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="external">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo deploy</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="external">Deployment</a></p>
]]></content>
    
    <summary type="html">
    
      &lt;p&gt;Welcome to &lt;a href=&quot;https://hexo.io/&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;Hexo&lt;/a&gt;! This is your very first post. Check &lt;a href=&quot;https://hexo.
    
    </summary>
    
    
  </entry>
  
</feed>
