-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
309 lines (246 loc) · 33.3 KB
/
atom.xml
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
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>攸妹のblog</title>
<link href="/atom.xml" rel="self"/>
<link href="http://jmoyo.com/"/>
<updated>2017-05-27T08:42:08.184Z</updated>
<id>http://jmoyo.com/</id>
<author>
<name>Jmoyo</name>
</author>
<generator uri="http://hexo.io/">Hexo</generator>
<entry>
<title>2017年五月21日</title>
<link href="http://jmoyo.com/2017/05/21/2017%E5%B9%B4%E4%BA%94%E6%9C%8821%E6%97%A5/"/>
<id>http://jmoyo.com/2017/05/21/2017年五月21日/</id>
<published>2017-05-21T11:45:07.000Z</published>
<updated>2017-05-27T08:42:08.184Z</updated>
<content type="html"><![CDATA[<p>昨天晚上攸妹做梦,说了句“草莓味的”,可能是白天跟她讨论狗肉烧什么味道好导致的,我说我喜欢麻辣的,她说喜欢草莓味道的。<br>今天下午阿爹带她去新华书店买玩具,买的又是一套朵拉的烧饭工具,家里烧饭套装已经几套了,大家一致认为攸妹以后可能是要向厨师方向发展。买玩具是因为去无锡玩,哥哥不分享玩具给她玩,所以阿爹阿婆答应攸妹回昆山给她买很多玩具。<br>( ‘▿ ‘ )<br><img src="http://i.imgur.com/gvtutLh.jpg" alt=""></p>
]]></content>
<summary type="html">
<p>昨天晚上攸妹做梦,说了句“草莓味的”,可能是白天跟她讨论狗肉烧什么味道好导致的,我说我喜欢麻辣的,她说喜欢草莓味道的。<br>今天下午阿爹带她去新华书店买玩具,买的又是一套朵拉的烧饭工具,家里烧饭套装已经几套了,大家一致认为攸妹以后可能是要向厨师方向发展。买玩具是因为去无锡
</summary>
<category term="攸妹成长" scheme="http://jmoyo.com/categories/%E6%94%B8%E5%A6%B9%E6%88%90%E9%95%BF/"/>
<category term="成长记录" scheme="http://jmoyo.com/tags/%E6%88%90%E9%95%BF%E8%AE%B0%E5%BD%95/"/>
</entry>
<entry>
<title>环秀晓筑的两天</title>
<link href="http://jmoyo.com/2017/02/06/%E7%8E%AF%E7%A7%80%E6%99%93%E7%AD%91%E7%9A%84%E4%B8%A4%E5%A4%A9/"/>
<id>http://jmoyo.com/2017/02/06/环秀晓筑的两天/</id>
<published>2017-02-06T13:10:07.000Z</published>
<updated>2017-05-27T08:42:08.184Z</updated>
<content type="html"><![CDATA[<p>过年回来刚上班两天,就请了一天假到环秀晓筑度假村嗨皮。时间还是太紧,两天时间不够,温泉勉强泡了一次,算是完成攸妹心心念念的愿望。回来路上攸妹睡着,到家后放到床上大哭不止,哭得呕吐、哽咽。直到看完朵拉以后才算重新满血复活。</p>
<a id="more"></a>
<p>这次单反带了,但照片拍的不多。最近攸妹太皮,一路上只顾照看,没有精力再多拍照片了。ps:最近喜欢用Fuji Astia 100F的滤镜</p>
<p><img src="http://ok18x00re.bkt.clouddn.com/blog/2017-02-06-_DSC2301_1.jpg" alt=""></p>
<p><img src="http://ok18x00re.bkt.clouddn.com/blog/2017-02-06-_DSC2327_1.jpg" alt=""></p>
<p><img src="http://ok18x00re.bkt.clouddn.com/blog/2017-02-06-_DSC2350_1.jpg" alt=""></p>
<p><img src="http://ok18x00re.bkt.clouddn.com/blog/2017-02-06-_DSC2369_1.jpg" alt=""></p>
<p><img src="http://ok18x00re.bkt.clouddn.com/blog/2017-02-06-_DSC2400.jpg" alt=""></p>
]]></content>
<summary type="html">
<p>过年回来刚上班两天,就请了一天假到环秀晓筑度假村嗨皮。时间还是太紧,两天时间不够,温泉勉强泡了一次,算是完成攸妹心心念念的愿望。回来路上攸妹睡着,到家后放到床上大哭不止,哭得呕吐、哽咽。直到看完朵拉以后才算重新满血复活。</p>
</summary>
<category term="攸妹成长" scheme="http://jmoyo.com/categories/%E6%94%B8%E5%A6%B9%E6%88%90%E9%95%BF/"/>
<category term="成长记录" scheme="http://jmoyo.com/tags/%E6%88%90%E9%95%BF%E8%AE%B0%E5%BD%95/"/>
</entry>
<entry>
<title>中证海外中国互联网50指数</title>
<link href="http://jmoyo.com/2017/01/18/%E4%B8%AD%E8%AF%81%E6%B5%B7%E5%A4%96%E4%B8%AD%E5%9B%BD%E4%BA%92%E8%81%94%E7%BD%9150%E6%8C%87%E6%95%B0/"/>
<id>http://jmoyo.com/2017/01/18/中证海外中国互联网50指数/</id>
<published>2017-01-18T14:27:14.000Z</published>
<updated>2017-05-27T08:42:08.184Z</updated>
<content type="html"><![CDATA[<p>易方达中国互联网50ETF(代码513050,简称中概互联)于2017年01月04日成立。跟踪的是中证海外中国互联网50指数。管理费率0.60%(每年),托管费率0.25%(每年)。</p>
<p>另一只跟踪中证海外中国互联网50指数的为2015年4月底推出的交银中国互联(代码164906,简称中国互联,LOF)。</p>
<a id="more"></a>
<blockquote>
<p>中证海外中国互联网50指数介绍:</p>
<p>选取海外交易所上市的中国互联网企业组成成分,以反映在在海外交易所上市中国互联网企业的整体走势。[官方链接][<a href="http://www.csindex.com.cn/sseportal/csiportal/zs/jbxx/report.do?code=H11136&&subdir=1],[历史走势查询][https://markets.ft.com/data/indices/tearsheet/summary?s=H11137:PSE" target="_blank" rel="external">http://www.csindex.com.cn/sseportal/csiportal/zs/jbxx/report.do?code=H11136&&subdir=1],[历史走势查询][https://markets.ft.com/data/indices/tearsheet/summary?s=H11137:PSE</a>]</p>
<p>主要权重股有:BAT,携程,京东,优酷土豆等。</p>
</blockquote>
<p>由于交银中国互联是非ETF型指数基金,预计在上涨期间,净值会落后于中概互联ETF。</p>
<p>交银中国互联(代码164906,LOF)自合同成立(2015年5月27日)以来,多数季度均能战胜业绩基准(中证海外中国互联网指数收益率×95%+银行活期存款利率(税后)×5%),累计战胜业绩基准约10个百分点,多数时间仓位未达基准仓位,二级市场成交量偏小。<img src="http://ok18x00re.bkt.clouddn.com/blog/2017-01-19-1.jpeg" alt=""></p>
]]></content>
<summary type="html">
<p>易方达中国互联网50ETF(代码513050,简称中概互联)于2017年01月04日成立。跟踪的是中证海外中国互联网50指数。管理费率0.60%(每年),托管费率0.25%(每年)。</p>
<p>另一只跟踪中证海外中国互联网50指数的为2015年4月底推出的交银中国互联(代码164906,简称中国互联,LOF)。</p>
</summary>
<category term="etf记录" scheme="http://jmoyo.com/categories/etf%E8%AE%B0%E5%BD%95/"/>
<category term="指数" scheme="http://jmoyo.com/tags/%E6%8C%87%E6%95%B0/"/>
<category term="etf" scheme="http://jmoyo.com/tags/etf/"/>
</entry>
<entry>
<title>指标、PE(TTM)及指数</title>
<link href="http://jmoyo.com/2017/01/05/%E6%8C%87%E6%A0%87%E3%80%81PE(TTM)%E5%8F%8A%E6%8C%87%E6%95%B0/"/>
<id>http://jmoyo.com/2017/01/05/指标、PE(TTM)及指数/</id>
<published>2017-01-05T15:11:59.000Z</published>
<updated>2017-05-27T08:42:08.184Z</updated>
<content type="html"><![CDATA[<h4 id="指数参考指标"><a href="#指数参考指标" class="headerlink" title="指数参考指标"></a>指数参考指标</h4><p><code>储蓄搬家</code> 可以发现最近三次储蓄搬家的时点分别为2007年10月、2009年10月和2015年5月</p>
<blockquote>
<p>数据参照:市盈率、M1、货币量、开户数、持仓帐户、个股主力线、散户线。</p>
</blockquote>
<p>大致策略为:</p>
<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">低于平均买1份</div><div class="line">低于平均的80%,买2份</div><div class="line">低于平均的70%,买4份</div><div class="line">低于平均的60%,买8份</div></pre></td></tr></table></figure>
<a id="more"></a>
<h4 id="TTM具体算法"><a href="#TTM具体算法" class="headerlink" title="TTM具体算法"></a>TTM具体算法</h4><p><strong>TTM(Trailing Tweleve Months)</strong></p>
<blockquote>
<p>a. 证监会要求4月底前所有的年报和季报出完。那么1-4月的数据,比如PE-TTM中归属于母公司的净利润就成为了:N-2年的四季报数据 + N-1年的前三季报数据。</p>
<p>b. 8月底前出完半年报,那么5-8月的数据就是:N-1年的二三四季度数据 + N年的一季度数据。</p>
<p>c. 10月底前出完三季报,那么9-10月的数据就是:N-1年的三四季度数据 + N年的一二季度数据</p>
<p>d. 最后11-12月的数据就是:N-1年的四季度数据 + N年的一二三季度数据。</p>
<p>如果深入看看以上这个数据,细心的朋友就会发现年报和一季报集中于3月份到4月份,尼玛,那不就没有用去年年报的数据了?是的,就是这样。</p>
<p>作者:b_ing<br>链接:<a href="https://xueqiu.com/4939534471/74550722" target="_blank" rel="external">https://xueqiu.com/4939534471/74550722</a><br>来源:雪球<br>著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。</p>
</blockquote>
<p><strong>csIndex</strong>和<strong>wind</strong>的<strong>PE(TTM)</strong>数据不同在于:</p>
<ul>
<li><strong>csIndex</strong>剔除了H股的市值和利润</li>
<li><strong>csIndex</strong>剔除了亏损股</li>
</ul>
<p>因此,<strong>csIndex</strong>得出的数据比<strong>wind</strong>的数据要大。</p>
<p><strong>rational-person网站加权平均值、算术平均值、中位数 </strong></p>
<blockquote>
<p>a. 加权平均值:所有公司总市值之和 / 所有公司归属于母公司所有者净利润之和。也就是把样本里的所有公司当成一家公司</p>
<p>b. 算术平均值:单独计算每家公司的PE TTM,为了剔除极端值对其的影响,剔除最高的和最低的10%,然后相加,再除以样本总数。</p>
<p>c. 中位数:单独计算每家公司的PE TTM,排序,如果样本数为奇数,取正中间的一个,如果样本数为偶数,去中间的两个加和然后除以2。</p>
</blockquote>
<p><strong>关注的指数</strong></p>
<p>上证180etf(510180)、深圳100etf(159901)、中小板etf(159902)、300etf(510300)、500etf(510500)、恒生etf(159920)、商品etf(510170)和医药etf(159929)、消费etf(159928)、黄金etf(518800)</p>
]]></content>
<summary type="html">
<h4 id="指数参考指标"><a href="#指数参考指标" class="headerlink" title="指数参考指标"></a>指数参考指标</h4><p><code>储蓄搬家</code> 可以发现最近三次储蓄搬家的时点分别为2007年10月、2009年10月和2015年5月</p>
<blockquote>
<p>数据参照:市盈率、M1、货币量、开户数、持仓帐户、个股主力线、散户线。</p>
</blockquote>
<p>大致策略为:</p>
<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">低于平均买1份</div><div class="line">低于平均的80%,买2份</div><div class="line">低于平均的70%,买4份</div><div class="line">低于平均的60%,买8份</div></pre></td></tr></table></figure>
</summary>
<category term="etf记录" scheme="http://jmoyo.com/categories/etf%E8%AE%B0%E5%BD%95/"/>
<category term="etf" scheme="http://jmoyo.com/tags/etf/"/>
<category term="基本概念" scheme="http://jmoyo.com/tags/%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5/"/>
</entry>
<entry>
<title>流感、呕吐、疲累的一周</title>
<link href="http://jmoyo.com/2016/12/25/%E6%B5%81%E6%84%9F%E3%80%81%E5%91%95%E5%90%90%E3%80%81%E7%96%B2%E7%B4%AF%E7%9A%84%E4%B8%80%E5%91%A8/"/>
<id>http://jmoyo.com/2016/12/25/流感、呕吐、疲累的一周/</id>
<published>2016-12-25T13:37:34.000Z</published>
<updated>2017-05-27T08:42:08.184Z</updated>
<content type="html"><![CDATA[<p>攸妹持续一周的发热今天终于好了,但中午还是吐了一次,好在精神状态很好。</p>
<p>上午一起做<em>“陶艺”</em></p>
<p><img src="http://ww3.sinaimg.cn/large/006tNc79gw1fb33vrmc51j31kw11u4g7.jpg" alt=""></p>
<p><a id="more"></a><img src="http://ww3.sinaimg.cn/large/006tNc79gw1fb33wjhqeqj31kw11utpd.jpg" alt=""></p>
<p><img src="http://ww3.sinaimg.cn/large/006tNc79gw1fb33ypc7bgj31kw11utsh.jpg" alt=""></p>
<p>捏了一个大臭臭送给妈妈😂。</p>
<p><img src="http://ww2.sinaimg.cn/large/006tNc79gw1fb33z60bnbj31kw11uk40.jpg" alt=""></p>
<p><img src="http://ww3.sinaimg.cn/large/006tNc79gw1fb33x72d5uj31kw11uh2t.jpg" alt="">晚上还要家庭聚餐,希望快快好起来。</p>
<p><img src="http://ww2.sinaimg.cn/large/006tNc79gw1fb3d6xvci5j31kw11vhdt.jpg" alt=""></p>
]]></content>
<summary type="html">
<p>攸妹持续一周的发热今天终于好了,但中午还是吐了一次,好在精神状态很好。</p>
<p>上午一起做<em>“陶艺”</em></p>
<p><img src="http://ww3.sinaimg.cn/large/006tNc79gw1fb33vrmc51j31kw11u4g7.jpg" alt=""></p>
<p>
</summary>
<category term="攸妹成长" scheme="http://jmoyo.com/categories/%E6%94%B8%E5%A6%B9%E6%88%90%E9%95%BF/"/>
<category term="成长记录" scheme="http://jmoyo.com/tags/%E6%88%90%E9%95%BF%E8%AE%B0%E5%BD%95/"/>
</entry>
<entry>
<title>持续集成daocloud同时部署hexo到coding和github</title>
<link href="http://jmoyo.com/2016/12/21/%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90daocloud%E5%90%8C%E6%97%B6%E9%83%A8%E7%BD%B2hexo%E5%88%B0coding%E5%92%8Cgithub/"/>
<id>http://jmoyo.com/2016/12/21/持续集成daocloud同时部署hexo到coding和github/</id>
<published>2016-12-21T12:02:34.000Z</published>
<updated>2017-05-27T08:42:08.184Z</updated>
<content type="html"><![CDATA[<h2 id="1-1搭建hexo"><a href="#1-1搭建hexo" class="headerlink" title="1.1搭建hexo"></a>1.1搭建hexo</h2><p>hexo优点在于可以搭建方便,小巧,部署命令简单。但缺点在于必须本地搭建环境生成静态网页后再部署,在不同电脑间使用只能重新搭建环境。</p>
<p>搭建方法参考:<a href="https://hexo.io/zh-cn/docs/index.html" target="_blank" rel="external">官方中文文档</a>。只需安装:<a href="https://nodejs.org/" target="_blank" rel="external">Node.js</a>和<a href="https://git-scm.com/downloads" target="_blank" rel="external">Git</a></p>
<a id="more"></a>
<p>常用命令:</p>
<figure class="highlight javascript"><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><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">sudo npm install hexo-cli -g <span class="comment">//安装hexo</span></div><div class="line">hexo init <span class="comment">//初始化</span></div><div class="line">npm install <span class="comment">//安装依赖包</span></div><div class="line">hexo g <span class="comment">//生成静态的网页至public目录</span></div><div class="line">hexo s <span class="comment">//开启本地服务,可以在本地预览</span></div><div class="line">hexo d <span class="comment">//上传生产的文件到配置的服务仓库(见_config.yml)</span></div><div class="line">hexo n <span class="string">"postName"</span> <span class="comment">//新建文章</span></div></pre></td></tr></table></figure>
<p>安装hexo过程中遇到的各种坑:</p>
<ol>
<li><p>执行<code>hexo d -g</code>可能出现ERROR Deployer not found: git或者 ERROR Deployer not found: github</p>
<p>执行:<code>npm install hexo-deployer-git —save</code></p>
</li>
<li><p>执行hexo无反应</p>
<p>执行:<code>npm install hexo-server —save</code> </p>
</li>
<li><p>执行安装<code>npm install hexo</code>时因某些原因可能需开代理,或者更换<code>npm</code><a href="https://npm.taobao.org" target="_blank" rel="external">淘宝镜像</a>。</p>
</li>
<li><p>执行<code>hexo g</code>时出现</p>
<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">ERROR Plugin load failed: hexo-generator-baidu-sitemap tab</div><div class="line">ReferenceError: hexo is not defined</div><div class="line">ERROR Plugin load failed: hexo-yuidoc</div><div class="line">ReferenceError: hexo is not defined</div></pre></td></tr></table></figure>
<p>执行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">npm install hexo-generator-sitemap@1 --save</div><div class="line">npm install hexo-generator-feed@1 --save</div></pre></td></tr></table></figure>
</li>
</ol>
<h2 id="1-2注册GitHub和Coding"><a href="#1-2注册GitHub和Coding" class="headerlink" title="1.2注册GitHub和Coding"></a>1.2注册GitHub和Coding</h2><p>由于国内访问GitHub不稳定,我们同时将hexo部署到Coding上,并且通过DNSPOD进行分流,将国外访问解析到GitHub上,国内解析到Coding。</p>
<p>另外Coding可以免费建私有库,后续hexo的源文件需要上传至私有库。</p>
<p>同时部署GitHub和Coding只需在执行<code>hexo d</code>之前配置好本地_config.yml文件,将GitHub和Coding地址加进去,最下面配置为:<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><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"># Deployment</div><div class="line">## Docs: https://hexo.io/docs/deployment.html</div><div class="line">deploy:</div><div class="line"> type: git</div><div class="line"> repo:</div><div class="line"> github: [email protected]:kaiqijiang/kaiqijiang.github.io.git,master</div><div class="line"> coding: [email protected]:jmoyo/jmoyo.git,master</div></pre></td></tr></table></figure></p>
<p>配置后执行<code>hexo d -g</code>就可以同时部署到GitHub和Coding。</p>
<blockquote>
<p>部署前SSH公钥要先分别加入至GitHub和Coding。<a href="https://coding.net/help/doc/git/ssh-key.html#ssh-" target="_blank" rel="external">添加方法</a></p>
</blockquote>
<h2 id="1-3不同电脑间部署hexo思路"><a href="#1-3不同电脑间部署hexo思路" class="headerlink" title="1.3不同电脑间部署hexo思路"></a>1.3不同电脑间部署hexo思路</h2><h3 id="1-3-1通过dropbox同步:"><a href="#1-3-1通过dropbox同步:" class="headerlink" title="1.3.1通过dropbox同步:"></a>1.3.1通过dropbox同步:</h3><ol>
<li>直接同步hexo整个目录:缺点是每次即使做了很小的更改,也会产生数量上万的文件需要同步。而且不同电脑下环境不同也无法运行,因此同步整个目录行不通。</li>
<li>同步目录下的配置文件及source等文件夹:缺点是每次需要手动复制文件夹到本地,生成静态网页完成部署后,又要复制回去,比较麻烦。而且本地电脑仍需要安装环境。</li>
</ol>
<h3 id="1-3-2通过在GitHub或Coding另建仓库或分支备份源文件"><a href="#1-3-2通过在GitHub或Coding另建仓库或分支备份源文件" class="headerlink" title="1.3.2通过在GitHub或Coding另建仓库或分支备份源文件"></a>1.3.2通过在GitHub或Coding另建仓库或分支备份源文件</h3><ul>
<li>这种方法较为普遍,但缺点有:</li>
</ul>
<ol>
<li>两台电脑同样需安装hexo环境。</li>
<li>需要使用Git命令较多,比较麻烦。</li>
<li>源码如果放GitHub上,隐私数据容易暴露,建议放在Coding私有库。</li>
</ol>
<h4 id="上传源文件到git"><a href="#上传源文件到git" class="headerlink" title="上传源文件到git"></a>上传源文件到git</h4><p>先删除文件夹下<code>.git</code>隐藏文件夹,<strong>注意<code>themes</code>文件夹中可能也有</strong>,编辑<code>.gitignore</code>文件,内容为:</p>
<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><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">.DS_Store</div><div class="line">Thumbs.db</div><div class="line">db.json</div><div class="line">*.log</div><div class="line">node_modules/</div><div class="line">public/</div><div class="line">.deploy*/</div></pre></td></tr></table></figure>
<p>根目录执行Git Bash,执行</p>
<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><div class="line">5</div></pre></td><td class="code"><pre><div class="line">git init</div><div class="line">git add .</div><div class="line">git commit -m “附加说明”</div><div class="line">git remote add origin https://git.coding.net/jmoyo/ci.git</div><div class="line">git push -u origin master</div></pre></td></tr></table></figure>
<h4 id="另一台电脑取回源文件"><a href="#另一台电脑取回源文件" class="headerlink" title="另一台电脑取回源文件"></a>另一台电脑取回源文件</h4><p>根目录执行</p>
<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">git init</div><div class="line">git remote add origin https://git.coding.net/jmoyo/ci.git</div><div class="line">git fetch --all</div><div class="line">git reset --hard origin/master</div></pre></td></tr></table></figure>
<p>这里使用<code>reset</code>是不做任何合并处理,<strong><em>强制将本地回退到和远程一样</em></strong>。如果用<code>git pull</code>命令还要考虑文件冲突问题。</p>
<h4 id="上传git进行备份"><a href="#上传git进行备份" class="headerlink" title="上传git进行备份"></a>上传git进行备份</h4><p><code>hexo d</code>完成部署博客后,重新上传新的源文件。执行:</p>
<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></pre></td><td class="code"><pre><div class="line">git add .</div><div class="line">git commit -m '附加说明'</div><div class="line">git push</div></pre></td></tr></table></figure>
<h3 id="1-3-3持续集成方式进行部署"><a href="#1-3-3持续集成方式进行部署" class="headerlink" title="1.3.3持续集成方式进行部署"></a>1.3.3持续集成方式进行部署</h3><ul>
<li>持续集成有<a href="https://www.appveyor.com/" target="_blank" rel="external">Travis CI</a>,<a href="https://www.appveyor.com/" target="_blank" rel="external">AppVeyor</a>,国内的有<a href="https://www.daocloud.io/" target="_blank" rel="external">DaoCloud</a>,三种对比使用后还是<a href="https://www.daocloud.io/" target="_blank" rel="external">DaoCloud</a>用下来最为方便,因为同为国内,可以直接支持Coding仓库的导入构建镜像,其次<a href="https://www.appveyor.com/" target="_blank" rel="external">AppVeyor</a>,使用也较简单,最后是<a href="https://www.appveyor.com/" target="_blank" rel="external">Travis CI</a>,访问时速度总是很慢。</li>
<li>虽然有人提到<a href="https://www.daocloud.io/" target="_blank" rel="external">DaoCloud</a>有时不稳定,而且相比较<a href="https://www.appveyor.com/" target="_blank" rel="external">Travis CI</a>、<a href="https://www.appveyor.com/" target="_blank" rel="external">AppVeyor</a>,也缺少<strong>Personal Access Token</strong>的加密解密功能,安全性上差一点。不过本身Coding也不支持<strong>Personal Access Token</strong>,所以也无所谓,好在Coding免费的私有库弥补了些缺陷。</li>
</ul>
<p>部署方式:</p>
<ul>
<li><code>Git push</code>hexo源文件到Coding上根目录</li>
<li>注册<a href="https://www.daocloud.io/" target="_blank" rel="external">DaoCloud</a></li>
<li>新建项目名称CI,选择导入Coding上私有库中的hexo源文件,开启<strong>持续集成</strong>,选择<code>master</code>根目录,手动构建镜像。查看镜像,记下镜像地址。</li>
<li>在本地根目录新建 <code>Dockerfile</code>文件,内容为:</li>
</ul>
<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><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div></pre></td><td class="code"><pre><div class="line">FROM node:slim</div><div class="line">#修改成和git config --global中的名字和邮箱</div><div class="line">MAINTAINER jmoyo <**@gmail.com></div><div class="line"># instal basic tool </div><div class="line">RUN apt-get update && apt-get install -y git ssh-client ca-certificates --no-install-recommends && rm -r /var/lib/apt/lists/*</div><div class="line"># set time zone</div><div class="line">RUN echo "Asia/Shanghai" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata</div><div class="line">RUN npm install</div><div class="line"># install hexo</div><div class="line">RUN npm install hexo-cli -g</div><div class="line"># install hexo server</div><div class="line">RUN npm install hexo-server</div><div class="line"># set base dir</div><div class="line">#RUN mkdir /hexo</div><div class="line"># set home dir</div><div class="line">#WORKDIR /hexo</div><div class="line"></div><div class="line">EXPOSE 4000</div><div class="line">#CMD ["/bin/bash"]</div></pre></td></tr></table></figure>
<ul>
<li>在本地根目录新建<code>daocloud.yml</code>文件,最近官方更新为2.0版本,<a href="http://docs.daocloud.io/ci-image-build/daocloud-yml-2-0-preview" target="_blank" rel="external">官方文档说明文档</a>。内容为:</li>
</ul>
<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><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div></pre></td><td class="code"><pre><div class="line">version: "2.0"</div><div class="line"> image: daocloud.io/jmoyo/ci:latest #修改为刚才镜像地址</div><div class="line"> install:</div><div class="line"> - npm install</div><div class="line"> before_script:</div><div class="line"> # 新建私钥文件夹</div><div class="line"> - mkdir ~/.ssh</div><div class="line"> # 移动私钥及ssh配置</div><div class="line"> - mv .daocloud/id_rsa ~/.ssh/id_rsa</div><div class="line"> - mv .daocloud/ssh_config ~/.ssh/config</div><div class="line"> # 赋予可读权限</div><div class="line"> - chmod 600 ~/.ssh/id_rsa</div><div class="line"> - chmod 600 ~/.ssh/config</div><div class="line"> # 启动ssh-agent</div><div class="line"> - eval $(ssh-agent)</div><div class="line"> # 添加私钥</div><div class="line"> - ssh-add ~/.ssh/id_rsa</div><div class="line"> # 删除整个私钥目录</div><div class="line"> - rm -rf .daocloud</div><div class="line"> # 配置git全局的用户名和邮件,和上面Dockerfile中一致</div><div class="line"> - git config --global user.name "Jmoyo"</div><div class="line"> - git config --global user.email "**@gmail.com"</div><div class="line"> script:</div><div class="line"> # hexo发布</div><div class="line"> - hexo clean</div><div class="line"> - hexo d -g</div><div class="line"> # 删除私钥文件夹</div><div class="line"> - rm -rf ~/.ssh/ </div><div class="line"> build:</div><div class="line"> lite_image:</div><div class="line"> compile:</div><div class="line"> dockerfile_path: Dockerfile</div><div class="line"> build_dir: /</div><div class="line"> cache: true</div></pre></td></tr></table></figure>
<ul>
<li>在根目录新建<code>.daocloud</code>文件夹,将本机<code>.ssh</code>目录中<code>id_rsa</code>放入该文件夹,再新增<code>ssh _config</code>文件,文件内容:</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">StrictHostKeyChecking no</div><div class="line">UserKnownHostsFile /dev/null</div></pre></td></tr></table></figure>
<p>随后,<code>git push</code>到Coding完成配置。</p>
<p><strong>后续使用</strong>:</p>
<p>直接本地写好md文章后,直接<code>git push</code>就可以了。甚至可以直接在Coding的<code>source/_posts</code>中直接新建或上传md文件。DaoCloud监测到变化后将自动构建,发布到Coding和GitHub服务上。</p>
<blockquote>
<p>这种方式主要缺点在于私钥是保存在Coding私有库里,没有像<a href="https://www.appveyor.com/" target="_blank" rel="external">Travis CI</a>、<a href="https://www.appveyor.com/" target="_blank" rel="external">AppVeyor</a>将个人私钥加密,安全性要差点。</p>
</blockquote>
<h1 id="2-参考文档"><a href="#2-参考文档" class="headerlink" title="2. 参考文档"></a>2. 参考文档</h1><ul>
<li><a href="http://www.jianshu.com/p/6d2ec4ca6186" target="_blank" rel="external">hexo搭建个人博客</a></li>
<li><a href="http://chitanda.me/2015/06/11/tips-for-setup-hexo/#git多网站ssh部署方案" target="_blank" rel="external">多网站ssh部署方案</a></li>
<li><a href="http://chitanda.me/2015/06/11/tips-for-setup-hexo/#npm安装hexo速度过慢" target="_blank" rel="external">npm安装hexo速度过慢</a></li>
<li><a href="http://ddr888.xyz/2016/08/hexo-deploy-git-docker/" target="_blank" rel="external">随时随地让Hexo持续部署</a></li>
<li><a href="http://imzlp.me/2016/10/21/using-travis-ci-deploy-hexo-blog-to-githubpages-and-codingpages/" target="_blank" rel="external">使用Travis CI自动部署Github/Coding Pages博客</a></li>
<li><a href="https://formulahendry.github.io/2016/12/04/hexo-ci/" target="_blank" rel="external">Hexo的版本控制与持续集成</a></li>
<li><a href="http://theme-next.iissnan.com/getting-started.html#select-scheme" target="_blank" rel="external">开始使用NexT主题</a></li>
<li><a href="https://www.haomwei.com/technology/maupassant-hexo.html" target="_blank" rel="external">hexo简洁主题推荐</a></li>
</ul>
]]></content>
<summary type="html">
<h2 id="1-1搭建hexo"><a href="#1-1搭建hexo" class="headerlink" title="1.1搭建hexo"></a>1.1搭建hexo</h2><p>hexo优点在于可以搭建方便,小巧,部署命令简单。但缺点在于必须本地搭建环境生成静态网页后再部署,在不同电脑间使用只能重新搭建环境。</p>
<p>搭建方法参考:<a href="https://hexo.io/zh-cn/docs/index.html" target="_blank" rel="external">官方中文文档</a>。只需安装:<a href="https://nodejs.org/" target="_blank" rel="external">Node.js</a>和<a href="https://git-scm.com/downloads" target="_blank" rel="external">Git</a></p>
</summary>
<category term="学习" scheme="http://jmoyo.com/categories/%E5%AD%A6%E4%B9%A0/"/>
<category term="学习记录" scheme="http://jmoyo.com/tags/%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/"/>
<category term="网络" scheme="http://jmoyo.com/tags/%E7%BD%91%E7%BB%9C/"/>
</entry>
</feed>