-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
314 lines (215 loc) · 18.6 KB
/
index.html
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="April is the most cruel season." />
<title>April</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="April is the most cruel season.">
<meta property="og:type" content="website">
<meta property="og:title" content="April">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="April">
<meta property="og:description" content="April is the most cruel season.">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="April">
<meta name="twitter:description" content="April is the most cruel season.">
<link rel="icon" href="/css/images/favicon.ico">
<link rel="stylesheet" href="/css/style.css">
<!-- baidu webmaster push -->
<script src='//push.zhanzhang.baidu.com/push.js'></script>
</head>
<body class="home blog custom-background custom-font-enabled single-author">
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<hgroup>
<h1 class="site-title">
<a href="/" title="April" rel="home">April</a>
</h1>
<script type="text/javascript" src="http://api.hitokoto.us/rand?encode=js&charset=utf-8"></script>
<h2 class="site-description"><script>hitokoto();</script></h2>
</hgroup>
<nav id="site-navigation" class="main-navigation" role="navigation">
<button class="menu-toggle">菜单</button>
<a class="assistive-text" href="/#content" title="跳至内容">跳至内容</a><!--TODO-->
<div class="menu-main-container">
<ul id="menu-main" class="nav-menu">
<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="/">home</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="/archives">archives</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="/categories">categories</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="/tag">tag</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="/feelings">feelings</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="/about">about</a></li>
</ul>
</div>
</nav>
</header>
<div id="main" class="wrapper">
<div id="primary" class="site-content"><div id="content" role="main">
<article id="post-The-First-Letter-To-Myself" class="post-The-First-Letter-To-Myself post type-post status-publish format-standard hentry">
<!---->
<header class="entry-header">
<h1 class="entry-title">
<a class="article-title" href="/2016/10/04/The-First-Letter-To-Myself/">The First Letter To Myself
只要坚持,没有什么做不到。</a>
</h1>
<div class="comments-link">
<a href="javascript:void(0);" data-url="http://yoursite.com/2016/10/04/The-First-Letter-To-Myself/" data-id="citvz5tr80005m8pi0x10nmzo" class="leave-reply bdsharebuttonbox" data-cmd="more">Share</a>
</div><!-- .comments-link -->
</header><!-- .entry-header -->
<div class="entry-content">
<p>这次博客的构建出现的问题如下:</p>
<p>##执行npm install hexo -g命令,一直报错,一直出现警告。</p>
<p>解决方法:我重新在另外一个盘中新建了一个文件夹,并在文该件夹下面打开了git.bash执行了以下命令:</p>
<pre><code>$ hexo init
$ npm install
</code></pre><p>输入第一条命令时会出现:</p>
<pre><code>Start Blogging with Hexo!
</code></pre><p> 然后再输入第二条命令。发现输入该条命令后,虽然安装成功,但是仍然有报错:</p>
<pre><code>npm WARN optional Skipping Failed optional dependence/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture:
</code></pre><p>后来在群里的回复说这两个警告可以忽略,于是问题解决。</p>
<p>##执行命令hexo deploy时又出错了,而且看过群里面的相关回答却发现相关的解决办法都没用。</p>
<p>错误如下:</p>
<pre><code>ERROR Deployer not found: github
</code></pre><p>解决办法:</p>
<p>1.type、repository、branch前面要加两个空格</p>
<p>2._config文件中type repository branch 三个冒号后面要加空格</p>
<p>3.type后的名字要用git</p>
<p>4.进行 npm install hexo-deployer-git –save 操作 后重新hexo d</p>
<p>我是进行了第四步操作才解决问题。</p>
<p>##经过之前的步骤后,我已经能够访问localhost:/4000网页,然而却是有的时候能够打开,有的时候却不能打开。</p>
<p>解决办法:</p>
<p>输了hexo server 之后 重新打开一个Bash 进去目录进行下面的操作,不要在进行hexo server操作时进行Ctrl c 操作,否则会打不开该网页。</p>
<p>##关于主题设置过程中的问题,我在导航栏上面新增加了两部分内容:<br> hexo new page “about”<br> hexo new page “feelings”<br>编辑了相关内容后,在主题的配置文件themes/cyansytle/_config.yml中添加:</p>
<pre><code>menu:
About: /about
Feelings: /feelings
</code></pre><p>然而在博客的导航栏中点击相关选项,跳出来的却是出错界面404.</p>
<p>解决方法:</p>
<p>配置文件很注意字母的大小写,我将menu里的大写字母都换成了小写,并且设置了language,将其设置为英文,之后再点击相关选项,就能够进入了。</p>
<p>后来我又重新增加了两部分内容:</p>
<pre><code>hexo new page “categories”
hexo new page “tag”
</code></pre><p>并且也在相应的配置文件中添加了</p>
<pre><code>menu:
categories: /categories
tag: /tag
</code></pre><p>##还未解决的问题:</p>
<p>###设置了自己的主题之后,由于该主题有点特殊,故很多同学们能用的教程,我根据提示完成相关操作后发现自己的博客上面不会有相应的功能。即我添加了相关的插件,但是打开网页时却不会显示出来。</p>
<p>如:</p>
<p>1.添加分享。</p>
<p>首先打开【百度分享】<a href="http://share.baidu.com/code" title="百度分享" target="_blank" rel="external">http://share.baidu.com/code</a>,获取代码。记得进行下一步按钮设置,可以对是否设置页面分享、图片分享、划词分享、按钮类型、风格、图标大小等功能。然后在themes/cyansytle/layout/_partial/目录下,新建一个baidu_analytics.ejs文件</p>
<blockquote>
<p>touch themes/light/layout/_partial/baidu_analytics.ejs</p>
</blockquote>
<p>将获取的代码写入baidu_analytics.ejs文件,最后在themes/light/layout/layout.ejs文件中添加百度统计,添加到标记前</p>
<blockquote>
<p><%- partial(‘_partial/baidu_analytics’) %></p>
</blockquote>
<p>2.添加微博show</p>
<p>首先到【微博开发平台】<a href="http://app.weibo.com/tool/weiboshow" title="微博分享平台" target="_blank" rel="external">http://app.weibo.com/tool/weiboshow</a>获取代码<br>然后在themes/light/layout/_widget/目录下,新建一个weibo_show.ejs文件,并且将刚获取的代码,写入该文件最后在themes/light/_config.yml文件中的widgets中添加weibo_show</p>
<pre><code>widgets:
- weibo_show
</code></pre><p>3.添加友情链接</p>
<p>首先在themes/light/layout/_widget/目录下,新建blogroll.ejs然后编辑文件</p>
<div class="widget tag"><br><h3 class="title">友情链接</h3><br><ul class="entry"><br><li><br> <a href="链接地址" title="title" target="_blank">显示名称</a><br></li><br></ul><br></div><br>最后在themes/light/_config.yml文件中的widgets中添加blogroll<br><br> widgets:<br> - blogroll<br>4.添加音乐插件<br><br>可以使用网易云音乐,搜索想要的歌曲,点击歌曲名字进入播放器页面,点击生成外链播放器;复制代码,直接粘贴到博文中即可。这样会显示一个网易的播放器,可以把<br> >< iframe frameborder=”no” border=”0” marginwidth=”0” marginheight=”0” width=298 height=52 src=”<a href="http://music.163.com/outchain/player?type=2&id=32192436&auto=1&height=32">" target="_blank" rel="external">http://music.163.com/outchain/player?type=2&id=32192436&auto=1&height=32"></a><br>><br>//其中的width=298 height=52 均改为0就看不到了,依然可以播放音乐<br><br><img src="http://upload-images.jianshu.io/upload_images/966908-656c1aff502007d5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="音乐插件"><br><br><img src="http://upload-images.jianshu.io/upload_images/966908-ec51c5639bc1a023.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="复制音乐地址"><br><br><br>但是以上操作完成后,我的博客却没能实现相应的功能<br><br>像分享,微博和友情链接,在博客的界面上面就是一串问号(这有跳可能是图标设置的问题),而音乐插件却是有时候能够跳出来,但有的时候却不出来,而且就算跳出来了,也不会播放音乐,之后我会查阅相关资料,来完善这些功能。<br><br>###我想要增加的功能:<br>1.集成多说评论,分享<br><br> 申请【多说】<a href="http://duoshuo.com/" title="多说" target="_blank" rel="external">http://duoshuo.com/</a>帐号,打开页面点击我要安装注册帐号<br><img src="http://upload-images.jianshu.io/upload_images/966908-ed14c379d74f2b7e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="多说站点"><br><br>在themes/cyanstyle目录下打开 _config.yml,设置<br><br> duoshuo_shortname: nanshanyi //上面多说域名中填的内容<br> 需要分享的打开duoshuo_share: true 即可,支持分享到微博、QQ空间、微信<br>然后打开themes\landscape\layout_partial\article.ejs文件<br>把以下代码<br><br><br>> <% if (!index && post.comments &&<br><br>> config.disqus_shortname){ %><br><br><br> <section id="comments"><br><br> <div id="disqus_thread"><br><br> <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript><br><br> </div>
<pre><code></section>
</code></pre><blockquote>
<p> <% } %></p>
</blockquote>
<p>替换为</p>
<p><% if (!index && post.comments && config.duoshuo_shortname){ %><br> <section id="comments"><br> <!-- 多说评论框 start --><br> <div class="ds-thread" data-thread-key="<%= post.layout %>-<%= post.slug %>" data-title="<%= post.title %>" data-url="<%= page.permalink %>"></div><br> <!-- 多说评论框 end --><br> <!-- 多说公共JS代码 start (一个网页只需插入一次) --><br> <script type="text/javascript"><br> var duoshuoQuery = {short_name:’<%= config.duoshuo_shortname %>’};<br> (function() {<br> var ds = document.createElement(‘script’);<br> ds.type = ‘text/javascript’;ds.async = true;<br> ds.src = (document.location.protocol == ‘https:’ ? ‘https:’ : ‘http:’) + ‘//static.duoshuo.com/embed.js’;<br> ds.charset = ‘UTF-8’;<br> (document.getElementsByTagName(‘head’)[0]<br> || document.getElementsByTagName(‘body’)[0]).appendChild(ds);<br> })();<br> </script><br> <!-- 多说公共JS代码 end --><br> </section><br> <% } %></p>
<p>然后你hexo s ,打开<a href="http://localhost:4000/" target="_blank" rel="external">http://localhost:4000/</a> 打开文章看一下,评论和分享已经静静的躺在那了<br><img src="http://upload-images.jianshu.io/upload_images/966908-8a2b28fd906fae93.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="多说pinglun"></p>
<p>2.添加cnzz站长统计</p>
<blockquote>
<p>添加站长统计</p>
</blockquote>
<p>到【友盟+】<a href="https://i.umeng.com/signup?spm=0.0.0.0.ma5nae" title="友盟+" target="_blank" rel="external">https://i.umeng.com/signup?spm=0.0.0.0.ma5nae</a>注册账户,并添加自己的网站域名,获取到一个站点ID,这个ID可以在地址栏里,或者自动生成的脚本里面找到。<br>在主题配置文件 _config.yml中添加如下字段:</p>
<pre><code>{% include '_scripts/third-party/analytics/cnzz-analytics.swig' %}
</code></pre><p>至此cnzz站长统计功能已经添加。由于默认默认不显示“站长统计”字样,所以从页面外观看不到任何变化。</p>
<blockquote>
<p>页脚添加“站长统计”链接</p>
</blockquote>
<p>修改\themes\next\layout_partials\footer.swig文件,在<span class="author" itemprop="copyrightHolder"></span>后面添加如下代码:<br></p>
<p>最终效果如图:<br><img src="http://www.wuxubj.cn/images/201608/010.jpg" alt="站长统计"></p>
<p>3.其它功能以后再慢慢补充。</p>
<h2 id="gt-有了梦想,便只顾风雨兼程。"><a href="#gt-有了梦想,便只顾风雨兼程。" class="headerlink" title="> 有了梦想,便只顾风雨兼程。"></a>> 有了梦想,便只顾风雨兼程。</h2><p>#####2016-10-04 23:07:48</p>
</section>
</div><!-- .entry-content -->
<footer class="entry-meta">
<a href="/2016/10/04/The-First-Letter-To-Myself/">
<time datetime="2016-10-04T15:07:48.820Z" class="entry-date">
2016-10-04
</time>
</a>
</footer>
</article>
<article id="post-hello-world" class="post-hello-world post type-post status-publish format-standard hentry">
<!---->
<header class="entry-header">
<h1 class="entry-title">
<a class="article-title" href="/2016/10/04/hello-world/">Hello World</a>
</h1>
<div class="comments-link">
<a href="javascript:void(0);" data-url="http://yoursite.com/2016/10/04/hello-world/" data-id="citvz5tpe0002m8pia3n9sk6q" class="leave-reply bdsharebuttonbox" data-cmd="more">Share</a>
</div><!-- .comments-link -->
</header><!-- .entry-header -->
<div class="entry-content">
<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>
</div><!-- .entry-content -->
<footer class="entry-meta">
<a href="/2016/10/04/hello-world/">
<time datetime="2016-10-04T09:44:41.826Z" class="entry-date">
2016-10-04
</time>
</a>
</footer>
</article>
</div></div>
<div id="secondary" class="widget-area" role="complementary">
<aside id="search" class="widget widget_search"><form role="search" method="get" accept-charset="utf-8" id="searchform" class="searchform" action="//google.com/search">
<div>
<input type="text" value="" name="s" id="s" />
<input type="submit" id="searchsubmit" value="搜索" />
</div>
</form></aside>
<aside class="widget">
<h3 class="widget-title">Recents</h3>
<div class="widget-content">
<ul>
<li>
<a href="/2016/10/04/The-First-Letter-To-Myself/">The First Letter To Myself
只要坚持,没有什么做不到。</a>
</li>
<li>
<a href="/2016/10/04/hello-world/">Hello World</a>
</li>
</ul>
</div>
</aside>
</div>
</div>
<footer id="colophon" role="contentinfo">
<p>© 2016 April~
All rights reserved.</p>
<p>Powered by <a href="http://hexo.io/" target="_blank">Hexo</a></p>
</footer>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"1","bdMiniList":false,"bdPic":"","bdStyle":"2","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
<script src="/js/jquery-2.0.3.min.js"></script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script src="/js/script.js"></script>
<script src="/js/navigation.js"></script>
<div id="bg"></div>
</div>
</body>
</html>