-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.xml
More file actions
105 lines (100 loc) · 7.04 KB
/
search.xml
File metadata and controls
105 lines (100 loc) · 7.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>使用hexo搭建blog</title>
<url>/2019/11/29/%E4%BD%BF%E7%94%A8hexo%E6%90%AD%E5%BB%BAblog/</url>
<content><![CDATA[<p> Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。<br> 以下主题设置,用的是主题next</p>
<a id="more"></a>
<h2 id="使用hexo搭建博客"><a href="#使用hexo搭建博客" class="headerlink" title="使用hexo搭建博客"></a>使用hexo搭建博客</h2><ol>
<li>安装node.js</li>
</ol>
<ul>
<li><p>先下载node.js。 <a href="https://nodejs.org/en/" target="_blank" rel="external nofollow noopener noreferrer">https://nodejs.org/en/</a> 一直下一步安装node</p>
</li>
<li><p>查看node安装是否成功 </p>
<blockquote>
<p>管理员登录终端 cmd<br>node -v<br>npm -v</p>
</blockquote>
</li>
<li><p>更换npm的下载源为淘宝镜像源</p>
<blockquote>
<p>npm install -g cnpm –registry=<a href="https://registry.npm.taobao.org" target="_blank" rel="external nofollow noopener noreferrer">https://registry.npm.taobao.org</a></p>
</blockquote>
</li>
</ul>
<ol start="2">
<li><p>安装hexo: cnpm install -g hexo-cli </p>
<blockquote>
<p>hexo -v查看是否安装成功</p>
</blockquote>
</li>
<li><p>使用hexo来搭建blog</p>
<blockquote>
<p>现在一个blog文件夹,并终端打开该文件夹。<br>hexo init - 初始化博客。需要下载git(官网下载即可,和下载node.js类似)<br>hexo s - 启动 本地4000端口 </p>
</blockquote>
</li>
<li><p>使用hexo发布文章</p>
<blockquote>
<p>hexo n “使用hexo搭建blog” - 新建一篇文章,然后打开该文章,编辑即可</p>
</blockquote>
</li>
</ol>
<p>退回到blog目录</p>
<blockquote>
<p>hexo clean - 清理<br>hexo g - 生成<br>hexo s</p>
</blockquote>
<h2 id="将搭建好的blog部署到github上"><a href="#将搭建好的blog部署到github上" class="headerlink" title="将搭建好的blog部署到github上"></a>将搭建好的blog部署到github上</h2><p>登录github,现在一个仓库</p>
<ul>
<li>新建仓库名: github昵称.github.io</li>
</ul>
<p>继续终端安装hexo的插件</p>
<ul>
<li>cnpm install –save hexo-deployer-git</li>
</ul>
<p>设置blog目录下的_config.yml文件。在文件末尾修改</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line"># Deployment</span></pre></td></tr><tr><td class="code"><pre><span class="line">## Docs: https://hexo.io/docs/deployment.html</span></pre></td></tr><tr><td class="code"><pre><span class="line">deploy:</span></pre></td></tr><tr><td class="code"><pre><span class="line"> type: git</span></pre></td></tr><tr><td class="code"><pre><span class="line"> repo: git仓库地址</span></pre></td></tr><tr><td class="code"><pre><span class="line"> branch: master</span></pre></td></tr></table></figure>
<p>部署到远端github - 404不成功应该是 ssh密钥或者git环境变量的问题</p>
<blockquote>
<p>hexo d<br>然后博客的url就变成了 仓库名</p>
</blockquote>
<h2 id="更换博客主题"><a href="#更换博客主题" class="headerlink" title="更换博客主题"></a>更换博客主题</h2><ul>
<li>git clone <a href="https://github.com/theme-next/hexo-theme-next" target="_blank" rel="external nofollow noopener noreferrer">https://github.com/theme-next/hexo-theme-next</a> themes/next</li>
<li>设置blog目录下的_config.yml文件。<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">theme: next</span></pre></td></tr></table></figure>
终端模式下<blockquote>
<p>hexo clean<br>hexo g<br>hexo s<br>hexo d </p>
</blockquote>
</li>
</ul>
<h2 id="主题设置"><a href="#主题设置" class="headerlink" title="主题设置"></a>主题设置</h2><p><a href="https://leyan.pro/2019/10/17/Next7%E4%B8%BB%E9%A2%98%E4%B8%AA%E6%80%A7%E5%8C%96%E8%AE%BE%E7%BD%AE/" target="_blank" rel="external nofollow noopener noreferrer">next主题设置1</a></p>
<p><a href="http://xietonglei.xyz/2019/11/13/Github+Hexo%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%EF%BC%884%EF%BC%89%E2%80%94Next%E4%B8%BB%E9%A2%98%E4%B8%AA%E6%80%A7%E5%8C%961/" target="_blank" rel="external nofollow noopener noreferrer">next主题设置2</a></p>
]]></content>
<categories>
<category>hexo</category>
</categories>
<tags>
<tag>blog</tag>
<tag>hexo</tag>
</tags>
</entry>
<entry>
<title>Hello World</title>
<url>/2019/11/29/hello-world/</url>
<content><![CDATA[<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="external nofollow noopener noreferrer">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="external nofollow noopener noreferrer">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 nofollow noopener noreferrer">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="external nofollow noopener noreferrer">GitHub</a>.</p>
<a id="more"></a>
<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="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="external nofollow noopener noreferrer">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="code"><pre><span class="line">$ hexo server</span></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="external nofollow noopener noreferrer">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="code"><pre><span class="line">$ hexo generate</span></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="external nofollow noopener noreferrer">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="code"><pre><span class="line">$ hexo deploy</span></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/one-command-deployment.html" target="_blank" rel="external nofollow noopener noreferrer">Deployment</a></p>
]]></content>
<categories>
<category>hexo</category>
</categories>
<tags>
<tag>hello</tag>
</tags>
</entry>
</search>