-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
725 lines (480 loc) · 38 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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
<link rel="mask-icon" href="/images/logo.svg" color="#222">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
<script id="hexo-configurations">
var NexT = window.NexT || {};
var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Mist","version":"7.8.0","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
</script>
<meta name="description" content="疾风知劲草,板荡识诚臣。">
<meta property="og:type" content="website">
<meta property="og:title" content="自为风月马前卒">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="自为风月马前卒">
<meta property="og:description" content="疾风知劲草,板荡识诚臣。">
<meta property="og:locale" content="en_US">
<meta property="article:author" content="Ying Zheng">
<meta name="twitter:card" content="summary">
<link rel="canonical" href="http://yoursite.com/">
<script id="page-configurations">
// https://hexo.io/docs/variables.html
CONFIG.page = {
sidebar: "",
isHome : true,
isPost : false,
lang : 'en'
};
</script>
<title>自为风月马前卒</title>
<noscript>
<style>
.use-motion .brand,
.use-motion .menu-item,
.sidebar-inner,
.use-motion .post-block,
.use-motion .pagination,
.use-motion .comments,
.use-motion .post-header,
.use-motion .post-body,
.use-motion .collection-header { opacity: initial; }
.use-motion .site-title,
.use-motion .site-subtitle {
opacity: initial;
top: initial;
}
.use-motion .logo-line-before i { left: initial; }
.use-motion .logo-line-after i { right: initial; }
</style>
</noscript>
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<div class="container use-motion">
<div class="headband"></div>
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="Toggle navigation bar">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
</div>
<div class="site-meta">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<h1 class="site-title">自为风月马前卒</h1>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
</div>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="main-menu menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>Categories</a>
</li>
</ul>
</nav>
</div>
</header>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
<main class="main">
<div class="main-inner">
<div class="content-wrap">
<div class="content index posts-expand">
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
<link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/04/20/configuration/hexo/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.png">
<meta itemprop="name" content="Ying Zheng">
<meta itemprop="description" content="疾风知劲草,板荡识诚臣。">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="自为风月马前卒">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/04/20/configuration/hexo/" class="post-title-link" itemprop="url">Hexo 搭建</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">Posted on</span>
<time title="Created: 2020-04-20 00:00:00 / Modified: 19:53:52" itemprop="dateCreated datePublished" datetime="2020-04-20T00:00:00+08:00">2020-04-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">In</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/configuration/" itemprop="url" rel="index"><span itemprop="name">-[configuration]</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="Hexo-Github-搭建个人博客"><a href="#Hexo-Github-搭建个人博客" class="headerlink" title="Hexo + Github 搭建个人博客"></a>Hexo + Github 搭建个人博客</h1><p>[TOC]</p>
<h2 id="技术工具:"><a href="#技术工具:" class="headerlink" title="技术工具:"></a>技术工具:</h2><ul>
<li>Git : 分布式管理系统</li>
<li>Node.js : 在本地运行JavaScript的引擎</li>
<li>npm : 包管理</li>
<li>hexo : 基于nodeJs的博客管理系统</li>
</ul>
<h2 id="安装过程"><a href="#安装过程" class="headerlink" title="安装过程"></a>安装过程</h2><blockquote>
<p>本文默认电脑已经安装过GIT</p>
</blockquote>
<h3 id="1-安装Node-js"><a href="#1-安装Node-js" class="headerlink" title="1.安装Node.js"></a>1.安装Node.js</h3><p><a href="https://nodejs.org/en/" target="_blank" rel="noopener">Node.js官网</a> 直接LTS安装即可</p>
<p><img src="https://img-blog.csdnimg.cn/20200419185858838.png" alt="在这里插入图片描述"></p>
<blockquote>
<p>Linux 下载:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install nodejs</span><br><span class="line">sudo apt-get install npm</span><br></pre></td></tr></table></figure>
</blockquote>
<p>安装完成之后,Node.js 与 npm 都安装成功</p>
<p><img src="https://img-blog.csdnimg.cn/20200419185953755.png" alt="在这里插入图片描述"></p>
<h3 id="2-npm-安装-hexo"><a href="#2-npm-安装-hexo" class="headerlink" title="2. npm 安装 hexo"></a>2. npm 安装 hexo</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo-cli</span><br></pre></td></tr></table></figure>
<p>安装完成 通过 <code>hexo -v</code> 测试</p>
<img src="https://img-blog.csdnimg.cn/20200419190022308.png" alt="在这里插入图片描述" style="zoom:67%;" />
<h3 id="3-初始化博客"><a href="#3-初始化博客" class="headerlink" title="3. 初始化博客"></a>3. 初始化博客</h3><p>建立新的文件夹:Blog</p>
<p>通过命令行,进入到Blog文件夹中</p>
<p>执行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init</span><br></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/20200419193713156.png" alt="在这里插入图片描述"></p>
<p>Blog文件夹目录</p>
<p><img src="https://img-blog.csdnimg.cn/20200419193948646.png" alt="在这里插入图片描述"></p>
<h3 id="4-启动Hexo博客"><a href="#4-启动Hexo博客" class="headerlink" title="4. 启动Hexo博客"></a>4. 启动Hexo博客</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/20200419194137781.png" alt="在这里插入图片描述"></p>
<p>打开<code>http://localhost:4000/</code> 即可在本地查看</p>
<p><img src="https://img-blog.csdnimg.cn/20200419194245603.png" alt="在这里插入图片描述"></p>
<h3 id="5-创建新博客"><a href="#5-创建新博客" class="headerlink" title="5. 创建新博客"></a>5. 创建新博客</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new "name"</span><br></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/20200419194647111.png" alt="在这里插入图片描述"></p>
<p>可以看到在<code>~\source\_post</code>中创立了新的<code>Hello-World-0.md</code></p>
<p>编辑<code>Hello-World-0.md</code></p>
<p><img src="https://img-blog.csdnimg.cn/20200419202533956.png" alt="在这里插入图片描述"></p>
<p>博客生成</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo g</span><br></pre></td></tr></table></figure>
<img src="https://img-blog.csdnimg.cn/20200419202755153.png" alt="在这里插入图片描述" style="zoom:67%;" />
<p>本地测试</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure>
<h3 id="6-部署到Github"><a href="#6-部署到Github" class="headerlink" title="6. 部署到Github"></a>6. 部署到Github</h3><p>在GITHUB上建立新仓库,仓库名必须是 <code>Github用户名 + .github.io</code></p>
<p>笔者的仓库(github名为caohongchuan)</p>
<p><img src="https://img-blog.csdnimg.cn/20200419210916277.png" alt="在这里插入图片描述"></p>
<p>在Blog文件夹 安装<code>hexo-deployer-git</code></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install --save hexo-deployer-git</span><br></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/20200419212056824.png" alt="在这里插入图片描述"></p>
<p>修改<code>_config.yml</code> 中的 deploy</p>
<p><img src="https://img-blog.csdnimg.cn/20200419212403455.png" alt="在这里插入图片描述"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"># Deployment</span><br><span class="line">## Docs: https://hexo.io/docs/deployment.html</span><br><span class="line">deploy:</span><br><span class="line"> type: git</span><br><span class="line"> repository: https://github.com/caohongchuan/caohongchuan.github.io.git</span><br><span class="line"> branch: master</span><br></pre></td></tr></table></figure>
<p>然后直接在<code>Blog</code>文件夹下 运行 </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo d</span><br></pre></td></tr></table></figure>
<p>即可发布到github中</p>
<h2 id="主题美化"><a href="#主题美化" class="headerlink" title="主题美化"></a>主题美化</h2><h3 id="1-安装Next主题"><a href="#1-安装Next主题" class="headerlink" title="1.安装Next主题"></a>1.安装Next主题</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone https://github.com/theme-next/hexo-theme-next themes/next</span><br></pre></td></tr></table></figure>
<p>国内太慢,可通过码云作为转接</p>
<p>修改<code>_config.yml</code> 中的 theme</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"># Extensions</span><br><span class="line">## Plugins: https://hexo.io/plugins/</span><br><span class="line">## Themes: https://hexo.io/themes/</span><br><span class="line">theme: next</span><br></pre></td></tr></table></figure>
<p>重新上传即可。如果更改next内部样式,通过<code>Blog\themes\next</code> 设置</p>
<h2 id="支持评论"><a href="#支持评论" class="headerlink" title="支持评论"></a>支持评论</h2><p>使用Gitalk进行增加评论功能</p>
<h3 id="1-创建OAuth-Application"><a href="#1-创建OAuth-Application" class="headerlink" title="1. 创建OAuth Application"></a>1. 创建OAuth Application</h3><p>在OAuth中创建 OAuth Apps</p>
<p><img src="https://img-blog.csdnimg.cn/20200419221831806.png" alt="在这里插入图片描述"></p>
<p>内部设置</p>
<img src="https://img-blog.csdnimg.cn/20200420131157810.png" alt="在这里插入图片描述" style="zoom:67%;" />
<p>完成后会生成相应的<code>clientID</code>and<code>clientSecret</code>。</p>
<p>在<code>Blog/themes/next/_config.yml</code></p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Gitalk</span></span><br><span class="line"><span class="comment"># For more information: https://gitalk.github.io, https://github.com/gitalk/gitalk</span></span><br><span class="line"><span class="attr">gitalk:</span></span><br><span class="line"> <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">github_id:</span> <span class="string">caohongchuan</span> <span class="comment"># GitHub repo owner</span></span><br><span class="line"> <span class="attr">repo:</span> <span class="string">caohongchuan.github.io</span> <span class="comment"># Repository name to store issues</span></span><br><span class="line"> <span class="attr">client_id:</span> <span class="string">XXXXXX(OAuth)</span> <span class="comment"># GitHub Application Client ID</span></span><br><span class="line"> <span class="attr">client_secret:</span> <span class="string">XXXXX(OAuth)</span> <span class="comment"># GitHub Application Client Secret</span></span><br><span class="line"> <span class="attr">admin_user:</span> <span class="string">caohongchuan</span> <span class="comment"># GitHub repo owner and collaborators, only these guys can initialize gitHub issues</span></span><br><span class="line"> <span class="attr">distraction_free_mode:</span> <span class="literal">true</span> <span class="comment"># Facebook-like distraction free mode</span></span><br><span class="line"> <span class="comment"># Gitalk's display language depends on user's browser or system environment</span></span><br><span class="line"> <span class="comment"># If you want everyone visiting your site to see a uniform language, you can set a force language value</span></span><br><span class="line"> <span class="comment"># Available values: en | es-ES | fr | ru | zh-CN | zh-TW</span></span><br><span class="line"> <span class="attr">language:</span> <span class="string">en</span> <span class="string">|</span> <span class="string">zh-CN</span></span><br></pre></td></tr></table></figure>
<p>测试成功:</p>
<p><img src="https://img-blog.csdnimg.cn/20200420140023749.png" alt="在这里插入图片描述"></p>
<h2 id="支持阅读数量统计"><a href="#支持阅读数量统计" class="headerlink" title="支持阅读数量统计"></a>支持阅读数量统计</h2><p>直接使用busuanzi_count 即可</p>
<p>在<code>/Blog/themes/next/_config.yml</code>修改</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Show Views / Visitors of the website / page with busuanzi.</span></span><br><span class="line"><span class="comment"># Get more information on http://ibruce.info/2015/04/04/busuanzi</span></span><br><span class="line"><span class="attr">busuanzi_count:</span></span><br><span class="line"> <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">total_visitors:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">total_visitors_icon:</span> <span class="string">fa</span> <span class="string">fa-user</span></span><br><span class="line"> <span class="attr">total_views:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">total_views_icon:</span> <span class="string">fa</span> <span class="string">fa-eye</span></span><br><span class="line"> <span class="attr">post_views:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">post_views_icon:</span> <span class="string">fa</span> <span class="string">fa-eye</span></span><br></pre></td></tr></table></figure>
<h2 id="支持数学公式"><a href="#支持数学公式" class="headerlink" title="支持数学公式"></a>支持数学公式</h2><h3 id="1-更换Hexo的markdown渲染引擎"><a href="#1-更换Hexo的markdown渲染引擎" class="headerlink" title="1. 更换Hexo的markdown渲染引擎"></a>1. 更换Hexo的markdown渲染引擎</h3><p>hexo-renderer-kramed引擎是在默认的渲染引擎,hexo-renderer-marked的基础上修改了一些bug。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm uninstall hexo-renderer-marked --save</span><br><span class="line">npm install hexo-renderer-kramed --save</span><br></pre></td></tr></table></figure>
<h3 id="2-修改Math"><a href="#2-修改Math" class="headerlink" title="2. 修改Math"></a>2. 修改Math</h3><p>修改<code>/Blog/themes/next/_config.yml</code> 中的 mathjax</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Math Formulas Render Support</span></span><br><span class="line"><span class="attr">math:</span></span><br><span class="line"> <span class="comment"># Default (true) will load mathjax / katex script on demand.</span></span><br><span class="line"> <span class="comment"># That is it only render those page which has `mathjax: true` in Front-matter.</span></span><br><span class="line"> <span class="comment"># If you set it to false, it will load mathjax / katex srcipt EVERY PAGE.</span></span><br><span class="line"> <span class="attr">per_page:</span> <span class="literal">true</span></span><br><span class="line"></span><br><span class="line"> <span class="comment"># hexo-renderer-pandoc (or hexo-renderer-kramed) required for full MathJax support.</span></span><br><span class="line"> <span class="attr">mathjax:</span></span><br><span class="line"> <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line"> <span class="comment"># See: https://mhchem.github.io/MathJax-mhchem/</span></span><br><span class="line"> <span class="attr">mhchem:</span> <span class="literal">true</span></span><br><span class="line"></span><br><span class="line"> <span class="comment"># hexo-renderer-markdown-it-plus (or hexo-renderer-markdown-it with markdown-it-katex plugin) required for full Katex support.</span></span><br><span class="line"> <span class="attr">katex:</span></span><br><span class="line"> <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line"> <span class="comment"># See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex</span></span><br><span class="line"> <span class="attr">copy_tex:</span> <span class="literal">false</span></span><br></pre></td></tr></table></figure>
<p>在每篇文件的开头加上<code>mathjax: true</code></p>
<p>举个例子</p>
<figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: Hello_World</span><br><span class="line">date: 2020-04-19 19:46:12</span><br><span class="line">tags:</span><br><span class="line">mathjax: true</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<p>测试成功:</p>
<p><img src="https://img-blog.csdnimg.cn/20200420152745159.png" alt="在这里插入图片描述"></p>
<h2 id="问题解决"><a href="#问题解决" class="headerlink" title="问题解决"></a>问题解决</h2><h3 id="1-自定义域名失效"><a href="#1-自定义域名失效" class="headerlink" title="1. 自定义域名失效"></a>1. 自定义域名失效</h3><p>问题描述:每次向Github推送时,自定义域名会失效</p>
<p>问题解决: 在<code>Blog/source</code> 中添加 <code>CNAME</code> 文件。 文件内容是自定义的域名</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://blog.caohongchuan.com</span><br></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/20200420133623831.png" alt="在这里插入图片描述"></p>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
<link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/04/20/proxy/shadowsocks/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.png">
<meta itemprop="name" content="Ying Zheng">
<meta itemprop="description" content="疾风知劲草,板荡识诚臣。">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="自为风月马前卒">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/04/20/proxy/shadowsocks/" class="post-title-link" itemprop="url">Ubuntu shadowsocks</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">Posted on</span>
<time title="Created: 2020-04-20 00:00:00 / Modified: 19:54:20" itemprop="dateCreated datePublished" datetime="2020-04-20T00:00:00+08:00">2020-04-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">In</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/proxy/" itemprop="url" rel="index"><span itemprop="name">-[proxy]</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="Ubuntu-shadowsocks"><a href="#Ubuntu-shadowsocks" class="headerlink" title="Ubuntu shadowsocks"></a>Ubuntu shadowsocks</h1><blockquote>
<p>The client and server are both in one package which contains two Scripts.</p>
</blockquote>
<ul>
<li>Clinet : <code>sslocal</code> </li>
<li>Server : <code>ssserver</code> </li>
</ul>
<p>In this article, I will use <code>shadowsocks-libev</code> to show in Ubuntu.</p>
<h2 id="1-Install-shadowsocks-libev"><a href="#1-Install-shadowsocks-libev" class="headerlink" title="1. Install shadowsocks-libev"></a>1. Install shadowsocks-libev</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt update</span><br><span class="line">sudo apt install shadowsocks-libev</span><br></pre></td></tr></table></figure>
<p><strong>There are some things to be writed</strong></p>
<hr>
<p>The Python Method:</p>
<h3 id="1-Install-pip"><a href="#1-Install-pip" class="headerlink" title="1. Install pip"></a>1. Install pip</h3><p><code>sudo apt install python3-pip</code></p>
<h3 id="2-Install-shadowsock"><a href="#2-Install-shadowsock" class="headerlink" title="2. Install shadowsock"></a>2. Install shadowsock</h3><p><code>pip3 install https://github.com/shadowsocks/shadowsocks/archive/master.zip</code></p>
<p>You can see the version using</p>
<p><code>ssserver --version</code></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Shadowsocks 3.0.0</span><br></pre></td></tr></table></figure>
<h3 id="3-Config-information"><a href="#3-Config-information" class="headerlink" title="3. Config information"></a>3. Config information</h3><p><code>sudo vim /etc/shadowsocks.json</code> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">{</span><br><span class="line"> "server":"0.0.0.0",</span><br><span class="line"> "server_port":9898,</span><br><span class="line"> "local_address":"127.0.0.1",</span><br><span class="line"> "local_port":1080,</span><br><span class="line"> "password":"password",</span><br><span class="line"> "timeout":300,</span><br><span class="line"> "method":"aes-256-cfb"</span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<h3 id="4-Open-the-shadowsocks"><a href="#4-Open-the-shadowsocks" class="headerlink" title="4. Open the shadowsocks"></a>4. Open the shadowsocks</h3><p><code>ssserver -c /etc/shadowsocks.json -d start</code></p>
<p>You can also close shadowsocks using</p>
<p><code>ssserver -c /etc/shadowsocks.json -d stop</code></p>
<p>You can check the port using</p>
<p><code>netstat -ap | grep 9898</code></p>
<p><strong>Note :You should open the port <code>9898</code> as you write in server_port in your cloud server.</strong></p>
<hr>
<p>Till to now the server is ready.<br>Then you can config and use shadowsocks in Window, Mac, Android or IOS!</p>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
<link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/04/20/Main/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.png">
<meta itemprop="name" content="Ying Zheng">
<meta itemprop="description" content="疾风知劲草,板荡识诚臣。">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="自为风月马前卒">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/04/20/Main/" class="post-title-link" itemprop="url">博客介绍</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">Posted on</span>
<time title="Created: 2020-04-20 00:00:00 / Modified: 19:54:40" itemprop="dateCreated datePublished" datetime="2020-04-20T00:00:00+08:00">2020-04-20</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="博客介绍"><a href="#博客介绍" class="headerlink" title="博客介绍"></a><strong>博客介绍</strong></h1><blockquote>
<p>搭建本博客的主要目的:</p>
<ul>
<li>记录学习中的知识点,便于复习</li>
<li>为面试中增加亮点</li>
</ul>
<p>原本打算本博客的所有文章全部英文编写,但正值2020新冠肺炎全球流行,世界反华情绪高涨。作为中华民族的一员,增强文化自信,传播中华文化是我们义不容辞的责任。</p>
<img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1918340315,2520997692&fm=26&gp=0.jpg" alt="img" style="zoom:150%;" />
</blockquote>
<h3 id="作者简介"><a href="#作者简介" class="headerlink" title="作者简介"></a>作者简介</h3><p>曹洪川,祖籍山东,现为山东大学(青岛)计算机科学与技术学院大三学生,将于2021年6月本科毕业。</p>
<p><strong>教育经历:</strong></p>
<p>本科:(2017 - 至今) 山东大学(青岛) 计算机科学与技术学院</p>
<p><strong>竞赛经历:</strong></p>
<p>2018年 : 全国大学生数学建模山东省一等奖</p>
<p>2019年:第十六次CCF计算机软件能力认证 300分</p>
<p>2019年:全国大学生数学建模山东省一等奖</p>
<p><strong>英语等级:</strong></p>
<p>四级: 540</p>
<p>六级: 410</p>
<p><strong>个人兴趣:</strong></p>
<p>编程,政治,经济</p>
<h3 id="博客主要内容:"><a href="#博客主要内容:" class="headerlink" title="博客主要内容:"></a>博客主要内容:</h3><p><img src="https://img-blog.csdnimg.cn/20200420194605610.png" alt="在这里插入图片描述"></p>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</div>
<script>
window.addEventListener('tabs:register', () => {
let { activeClass } = CONFIG.comments;
if (CONFIG.comments.storage) {
activeClass = localStorage.getItem('comments_active') || activeClass;
}
if (activeClass) {
let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
if (activeTab) {
activeTab.click();
}
}
});
if (CONFIG.comments.storage) {
window.addEventListener('tabs:click', event => {
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
let commentClass = event.target.classList[1];
localStorage.setItem('comments_active', commentClass);
});
}
</script>
</div>
<div class="toggle sidebar-toggle">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
<aside class="sidebar">
<div class="sidebar-inner">
<ul class="sidebar-nav motion-element">
<li class="sidebar-nav-toc">
Table of Contents
</li>
<li class="sidebar-nav-overview">
Overview
</li>
</ul>
<!--noindex-->
<div class="post-toc-wrap sidebar-panel">
</div>
<!--/noindex-->
<div class="site-overview-wrap sidebar-panel">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image" alt="Ying Zheng"
src="/images/avatar.png">
<p class="site-author-name" itemprop="name">Ying Zheng</p>
<div class="site-description" itemprop="description">疾风知劲草,板荡识诚臣。</div>
</div>
<div class="site-state-wrap motion-element">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="/archives">
<span class="site-state-item-count">3</span>
<span class="site-state-item-name">posts</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories/">
<span class="site-state-item-count">2</span>
<span class="site-state-item-name">categories</span></a>
</div>
</nav>
</div>
<div class="links-of-author motion-element">
<span class="links-of-author-item">
<a href="https://github.com/caohongchuan" title="GitHub → https://github.com/caohongchuan" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
</span>
<span class="links-of-author-item">
<a href="mailto:[email protected]" title="E-Mail → mailto:[email protected]" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
</span>
<span class="links-of-author-item">
<a href="https://twitter.com/yingzhengttt" title="Twitter → https://twitter.com/yingzhengttt" rel="noopener" target="_blank"><i class="fab fa-twitter fa-fw"></i>Twitter</a>
</span>
</div>
</div>
</div>
</aside>
<div id="sidebar-dimmer"></div>
</div>
</main>
<footer class="footer">
<div class="footer-inner">
<div class="copyright">
©
<span itemprop="copyrightYear">2020</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">Ying Zheng</span>
</div>
<div class="busuanzi-count">
<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
<span class="post-meta-item-icon">
<i class="fa fa-user"></i>
</span>
<span class="site-uv" title="Total Visitors">
<span id="busuanzi_value_site_uv"></span>
</span>
</span>
<span class="post-meta-divider">|</span>
<span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span class="site-pv" title="Total Views">
<span id="busuanzi_value_site_pv"></span>
</span>
</span>
</div>
</div>
</footer>
</div>
<script src="/lib/anime.min.js"></script>
<script src="/lib/velocity/velocity.min.js"></script>
<script src="/lib/velocity/velocity.ui.min.js"></script>
<script src="/js/utils.js"></script>
<script src="/js/motion.js"></script>
<script src="/js/schemes/muse.js"></script>
<script src="/js/next-boot.js"></script>
<script>
if (document.querySelectorAll('pre.mermaid').length) {
NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
mermaid.initialize({
theme : 'forest',
logLevel : 3,
flowchart: { curve : 'linear' },
gantt : { axisFormat: '%m/%d/%Y' },
sequence : { actorMargin: 50 }
});
}, window.mermaid);
}
</script>
</body>
</html>