-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwin10-hexo-github.html
More file actions
1614 lines (1031 loc) · 60.2 KB
/
Copy pathwin10-hexo-github.html
File metadata and controls
1614 lines (1031 loc) · 60.2 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
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
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html class="theme-next pisces use-motion" lang="en">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
<link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />
<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />
<meta name="keywords" content="hexo," />
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico?v=5.1.1" />
<meta name="description" content="win10+hexo+github搭建个人博客 参考:https://hexo.io/,博客用于记录自己的学习工作历程 参考以下步骤安装 1、搭建环境准备(包括node.js和git环境,gitHub账户的配置)2、安装 配置Hexo,配置将Hexo与github page结合起来3、怎样发布文章 主题 推荐 主题4、Net的简单配置 添加sitemap和feed插件5、添加404 公益页面">
<meta name="keywords" content="hexo">
<meta property="og:type" content="article">
<meta property="og:title" content="win10+hexo+github搭建个人博客">
<meta property="og:url" content="http://itdevops.me/win10-hexo-github.html">
<meta property="og:site_name" content="itdevops">
<meta property="og:description" content="win10+hexo+github搭建个人博客 参考:https://hexo.io/,博客用于记录自己的学习工作历程 参考以下步骤安装 1、搭建环境准备(包括node.js和git环境,gitHub账户的配置)2、安装 配置Hexo,配置将Hexo与github page结合起来3、怎样发布文章 主题 推荐 主题4、Net的简单配置 添加sitemap和feed插件5、添加404 公益页面">
<meta property="og:image" content="http://img.blog.csdn.net/20170711215441177?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170711215556298?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170711215846144?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170711222448718?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170711222510967?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170712085631907?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170712085650532?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170712093352566?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:updated_time" content="2017-07-13T01:27:03.486Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="win10+hexo+github搭建个人博客">
<meta name="twitter:description" content="win10+hexo+github搭建个人博客 参考:https://hexo.io/,博客用于记录自己的学习工作历程 参考以下步骤安装 1、搭建环境准备(包括node.js和git环境,gitHub账户的配置)2、安装 配置Hexo,配置将Hexo与github page结合起来3、怎样发布文章 主题 推荐 主题4、Net的简单配置 添加sitemap和feed插件5、添加404 公益页面">
<meta name="twitter:image" content="http://img.blog.csdn.net/20170711215441177?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<script type="text/javascript" id="hexo.configurations">
var NexT = window.NexT || {};
var CONFIG = {
root: '/',
scheme: 'Pisces',
sidebar: {"position":"left","display":"hide","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false,"onmobile":false},
fancybox: true,
motion: true,
duoshuo: {
userId: '0',
author: 'Author'
},
algolia: {
applicationID: 'U8MQWLDAST',
apiKey: '384049ed6950049c287808e92fdeeb15',
indexName: 'itdevops',
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"}
}
};
</script>
<link rel="canonical" href="http://itdevops.me/win10-hexo-github.html"/>
<title>win10+hexo+github搭建个人博客 | itdevops</title>
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?7cbe87eb0cc597b4c1e10030e5e856d5";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="en">
<a href="https://github.com/itdevops/awesomeopus"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/567c3a48d796e2fc06ea80409cc9dd82bf714434/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png"></a>
<div class="container sidebar-position-left page-post-detail ">
<div class="headband"></div>
<header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-wrapper">
<div class="site-meta ">
<div class="custom-logo-site-title">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<span class="site-title">itdevops</span>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<p class="site-subtitle">DevOps is everything</p>
</div>
<div class="site-nav-toggle">
<button>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
</button>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section">
<i class="menu-item-icon fa fa-fw fa-home"></i> <br />
Home
</a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories/" rel="section">
<i class="menu-item-icon fa fa-fw fa-th"></i> <br />
Categories
</a>
</li>
<li class="menu-item menu-item-about">
<a href="/about" rel="section">
<i class="menu-item-icon fa fa-fw fa-user"></i> <br />
About
</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section">
<i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
Archives
</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags" rel="section">
<i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
Tags
</a>
</li>
<li class="menu-item menu-item-commonweal">
<a href="/404.html" rel="section">
<i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br />
Commonweal 404
</a>
</li>
<li class="menu-item menu-item-life">
<a href="/categories/life" rel="section">
<i class="menu-item-icon fa fa-fw fa-home"></i> <br />
life
</a>
</li>
<li class="menu-item menu-item-search">
<a href="javascript:;" class="popup-trigger">
<i class="menu-item-icon fa fa-search fa-fw"></i> <br />
Search
</a>
</li>
</ul>
<div class="site-search">
<div class="popup search-popup local-search-popup">
<div class="local-search-header clearfix">
<span class="search-icon">
<i class="fa fa-search"></i>
</span>
<span class="popup-btn-close">
<i class="fa fa-times-circle"></i>
</span>
<div class="local-search-input-wrapper">
<input autocomplete="off"
placeholder="Searching..." spellcheck="false"
type="text" id="local-search-input">
</div>
</div>
<div id="local-search-result"></div>
</div>
</div>
</nav>
</div>
</header>
<main id="main" class="main">
<div class="main-inner">
<div class="content-wrap">
<div id="content" class="content">
<div id="posts" class="posts-expand">
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<link itemprop="mainEntityOfPage" href="http://itdevops.me/win10-hexo-github.html">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Shaonbean">
<meta itemprop="description" content="">
<meta itemprop="image" content="http://avatar.csdn.net/6/A/9/1_wh211212.jpg">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="itdevops">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">win10+hexo+github搭建个人博客</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">Posted on</span>
<time title="Post created" itemprop="dateCreated datePublished" datetime="2017-07-12T13:05:21+08:00">
2017-07-12
</time>
</span>
<span class="post-category" >
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">In</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/Hexo/" itemprop="url" rel="index">
<span itemprop="name">Hexo</span>
</a>
</span>
</span>
<span class="post-comments-count">
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-comment-o"></i>
</span>
<a href="/win10-hexo-github.html#comments" itemprop="discussionUrl">
<span class="post-comments-count disqus-comment-count"
data-disqus-identifier="win10-hexo-github.html" itemprop="commentCount"></span>
</a>
</span>
<span id="/win10-hexo-github.html" class="leancloud_visitors" data-flag-title="win10+hexo+github搭建个人博客">
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">Visitors </span>
<span class="leancloud-visitors-count"></span>
</span>
<div class="post-wordcount">
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-file-word-o"></i>
</span>
<span class="post-meta-item-text">Words count in article</span>
<span title="Words count in article">
1,200
</span>
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-clock-o"></i>
</span>
<span class="post-meta-item-text">Reading time</span>
<span title="Reading time">
5
</span>
</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="win10-hexo-github搭建个人博客"><a href="#win10-hexo-github搭建个人博客" class="headerlink" title="win10+hexo+github搭建个人博客"></a>win10+hexo+github搭建个人博客</h1><blockquote>
<p>参考:<a href="https://hexo.io/,博客用于记录自己的学习工作历程" target="_blank" rel="external">https://hexo.io/,博客用于记录自己的学习工作历程</a></p>
</blockquote>
<h2 id="参考以下步骤安装"><a href="#参考以下步骤安装" class="headerlink" title="参考以下步骤安装"></a>参考以下步骤安装</h2><blockquote>
<p>1、搭建环境准备(包括node.js和git环境,gitHub账户的配置)<br>2、安装 配置Hexo,配置将Hexo与github page结合起来<br>3、怎样发布文章 主题 推荐 主题<br>4、Net的简单配置 添加sitemap和feed插件<br>5、添加404 公益页面</p>
</blockquote>
<h2 id="安装并配置环境"><a href="#安装并配置环境" class="headerlink" title="安装并配置环境"></a>安装并配置环境</h2><blockquote>
<p>win10+Node.js+git+github</p>
</blockquote>
<ul>
<li>Node.js下载地址:<a href="https://nodejs.org/en/download/" target="_blank" rel="external">https://nodejs.org/en/download/</a></li>
<li>Git下载地址:<a href="https://git-scm.com/" target="_blank" rel="external">https://git-scm.com/</a></li>
<li>Github 地址:<a href="https://github.com" target="_blank" rel="external">https://github.com</a></li>
</ul>
<blockquote>
<p>安装node.js 和 git 步骤省略,按默认傻瓜式安装即可</p>
</blockquote>
<h2 id="注册github账号并创建一个以-github昵称-github-io-命名的仓库"><a href="#注册github账号并创建一个以-github昵称-github-io-命名的仓库" class="headerlink" title="注册github账号并创建一个以 github昵称.github.io 命名的仓库"></a>注册github账号并创建一个以 github昵称.github.io 命名的仓库</h2><p><img src="http://img.blog.csdn.net/20170711215441177?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="reg-github"></p>
<blockquote>
<p>根据图中,注册一个github账号,昵称自定义,然后创建一个新项目,名字为:github昵称.github.io</p>
</blockquote>
<ul>
<li>项目创建完成之后,本地生成ssh 私钥和公钥,用于连接github认证,使用上面下载的git,打开git bash</li>
</ul>
<p><img src="http://img.blog.csdn.net/20170711215556298?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="ssh-shaonbean"></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">ssh-keygen -t rsa -C "github注册邮箱(自定义)" -f .ssh/shaonbean</div><div class="line"># -f 输出以昵称命名的公钥和私钥,方便记忆</div></pre></td></tr></table></figure>
<ul>
<li>公钥生成之后加到github上,方便后面的使用,用户本地和github进行ssh通信</li>
</ul>
<p><img src="http://img.blog.csdn.net/20170711215846144?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="ssh-add-github"></p>
<blockquote>
<p>到这里github设置告一段落</p>
</blockquote>
<h2 id="安装配置hexo"><a href="#安装配置hexo" class="headerlink" title="安装配置hexo"></a>安装配置hexo</h2><blockquote>
<p>注:hexo安装前提需安装node.js 和git</p>
</blockquote>
<ul>
<li>hexo官网:<a href="https://hexo.io/" target="_blank" rel="external">https://hexo.io/</a></li>
<li>hexo官方文档:<a href="https://hexo.io/docs/" target="_blank" rel="external">https://hexo.io/docs/</a></li>
</ul>
<blockquote>
<p>文中以J盘为例,创建目录github并创建字目录(用于存放项目)</p>
</blockquote>
<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">vdevops@shaon MINGW64 /j/github/shaonbean</div><div class="line"># 注: 如果是linux环境下搭建的hexo博客,不建议使用root权限</div></pre></td></tr></table></figure>
<ul>
<li>下载安装hexo</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></pre></td><td class="code"><pre><div class="line">npm install -g hexo-cli</div><div class="line"># 等待片刻,执行hexo如下图表示安装成功</div><div class="line">hexo</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20170711222448718?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<ul>
<li>初始化博客</li>
</ul>
<blockquote>
<p>这里以shaonbean为博客目录,执行下面命令</p>
</blockquote>
<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">hexo init shaonbean # 创始化项目</div><div class="line">cd shaonbean</div><div class="line">npm install</div></pre></td></tr></table></figure>
<ul>
<li>测试本地建站是否成功,输入:</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></pre></td><td class="code"><pre><div class="line">hexo s</div><div class="line">INFO Start processing</div><div class="line">INFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.</div><div class="line"># 出现上面两行,即表示本地建站成功</div></pre></td></tr></table></figure>
<ul>
<li>初始化博客以后,能看到下图:</li>
</ul>
<p><img src="http://img.blog.csdn.net/20170711222510967?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="hexo"></p>
<ul>
<li>配置博客</li>
</ul>
<blockquote>
<p>博客根目录初始化完成之后进项自定义配置,这里用到_config.yml</p>
</blockquote>
<h3 id="自定义博客的相关信息"><a href="#自定义博客的相关信息" class="headerlink" title="自定义博客的相关信息"></a>自定义博客的相关信息</h3><blockquote>
<p>编辑_config.yml配置文件,进行修改,参考下面配置:</p>
</blockquote>
<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">title: itdevops</div><div class="line">subtitle: DevOps is everything</div><div class="line">description: From Zero to the DevOps</div><div class="line">author: shaonbean</div><div class="line">language: zh-CN</div><div class="line">timezone: Asia/Shanghai</div><div class="line"># language和timezone 有规范,注意格式</div></pre></td></tr></table></figure>
<h3 id="配置个人域名"><a href="#配置个人域名" class="headerlink" title="配置个人域名"></a>配置个人域名</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">url: http://vdevops.com</div></pre></td></tr></table></figure>
<h3 id="配置部署"><a href="#配置部署" class="headerlink" title="配置部署"></a>配置部署</h3><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">deploy:</div><div class="line"> type: git</div><div class="line"> repo: https://github.com/shaonbean/shaonbean.github.io.git</div><div class="line"> branch: master</div></pre></td></tr></table></figure>
<blockquote>
<p>repo项是之前Github上创建好的仓库的地址</p>
</blockquote>
<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">exec ssh-agent bash</div><div class="line">ssh-add MYKEY</div><div class="line"># 这里是针对本地设置多个github账号进行操作</div></pre></td></tr></table></figure>
<ul>
<li>本地生成两对密钥对,然后在~/.ssh/目录下新建config文件,参考下面填入:</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></pre></td><td class="code"><pre><div class="line">#————GitHub—————</div><div class="line">Host github</div><div class="line"> HostName github.com</div><div class="line"> User git</div><div class="line"> PreferredAuthentications publickey</div><div class="line"> IdentityFile ~/.ssh/id_rsa</div><div class="line"></div><div class="line"># github.io</div><div class="line">Host github.io</div><div class="line"> HostName github.com</div><div class="line"> User git</div><div class="line"> PreferredAuthentications publickey</div><div class="line"> IdentityFile ~/.ssh/itdevops</div></pre></td></tr></table></figure>
<ul>
<li>测试本地ssh连接github是否正常</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></pre></td><td class="code"><pre><div class="line">ssh -T git@github</div><div class="line">ssh -T git@github.io</div><div class="line"># 笔者这里第二个账号没设置成功,临时使用的https方式进行的通信</div></pre></td></tr></table></figure>
<ul>
<li>使用https,github账号加密码的方式来进行hexo的部署。配置如下:</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></pre></td><td class="code"><pre><div class="line">deploy:</div><div class="line"> type: git</div><div class="line"> #repo: git@github.io:shaonbean/shaonbean.github.io.git</div><div class="line"> repo: https://shaonbean:shaonbeanpassword@github.com/shaonbean/shaonbean.github.io.git</div><div class="line"> branch: master</div><div class="line"> message: devops</div></pre></td></tr></table></figure>
<h3 id="配置完成之后,现在可以进到设置的项目目录里面通过hexo部署到github"><a href="#配置完成之后,现在可以进到设置的项目目录里面通过hexo部署到github" class="headerlink" title="配置完成之后,现在可以进到设置的项目目录里面通过hexo部署到github"></a>配置完成之后,现在可以进到设置的项目目录里面通过hexo部署到github</h3><blockquote>
<p>进到你的项目目录。命令行执行下面命令:</p>
</blockquote>
<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">hexo g # 本地生成数据库文件,目录等</div><div class="line">hexo d # 部署到远程</div></pre></td></tr></table></figure>
<ul>
<li>新建一篇博客</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 new post "devops"</div></pre></td></tr></table></figure>
<blockquote>
<p>然后通过电脑编辑器(atom)对文章进行编辑,编辑完成之后,再次运行上面的生成,部署命令</p>
</blockquote>
<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">hexo g # 本地生成博客</div><div class="line">hexo d # 发布到远程</div><div class="line">hexo d -g #在部署前先生成</div></pre></td></tr></table></figure>
<blockquote>
<p>注: 安装git扩展</p>
</blockquote>
<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-deployer-git --save</div><div class="line"># 没安装插件可能报错:deloyer not found:git</div></pre></td></tr></table></figure>
<ul>
<li>ssh key报错</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></pre></td><td class="code"><pre><div class="line">Permission denied (publickey).</div><div class="line">fatal: Could not read from remote repository.</div><div class="line">Please make sure you have the correct access rights</div><div class="line">and the repository exists.</div></pre></td></tr></table></figure>
<blockquote>
<p>后面笔者会专门写一篇添加ssh 密钥的文章</p>
</blockquote>
<ul>
<li>部署完成可以看到github上面shaonbean.github.io,已经存在文件,通过浏览器访问如下:</li>
</ul>
<p><img src="http://img.blog.csdn.net/20170712085631907?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="github"></p>
<p><img src="http://img.blog.csdn.net/20170712085650532?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="itdevops"></p>
<blockquote>
<p>从上面可以看出我们已经成功部署到远程,并能够正常访问。</p>
</blockquote>
<h3 id="配置博客主题"><a href="#配置博客主题" class="headerlink" title="配置博客主题"></a>配置博客主题</h3><blockquote>
<p>选择NexT,star最多,原因不多说<br>知乎主题推荐:<a href="https://www.zhihu.com/question/24422335" target="_blank" rel="external">https://www.zhihu.com/question/24422335</a></p>
</blockquote>
<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">cd /j/github/shaonbean.github.io # 这里项目名可以自定义</div><div class="line">git clone https://github.com/iissnan/hexo-theme-next themes/next</div></pre></td></tr></table></figure>
<ul>
<li>更换主题完成后,访问:</li>
</ul>
<p><img src="http://img.blog.csdn.net/20170712093352566?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2gyMTEyMTI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="next"></p>
<h3 id="参考链接"><a href="#参考链接" class="headerlink" title="参考链接"></a>参考链接</h3><ul>
<li><a href="http://blog.csdn.net/gdutxiaoxu/article/details/53576018" target="_blank" rel="external">http://blog.csdn.net/gdutxiaoxu/article/details/53576018</a></li>
<li><a href="http://www.jeyzhang.com/hexo-github-blog-building.html" target="_blank" rel="external">http://www.jeyzhang.com/hexo-github-blog-building.html</a></li>
<li><a href="https://www.zrj96.com/post-471.html" target="_blank" rel="external">https://www.zrj96.com/post-471.html</a></li>
<li><a href="https://fuyis.me/2017/01/25/Hexo-theme-next-and-optimized-configuration/" target="_blank" rel="external">https://fuyis.me/2017/01/25/Hexo-theme-next-and-optimized-configuration/</a></li>
</ul>
</div>
<div>
</div>
<div>
<div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
<div>Insist on the original technology sharing, your support will encourage me to continue to create!</div>
<button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
<span>赏</span>
</button>
<div id="QR" style="display: none;">
<div id="wechat" style="display: inline-block">
<img id="wechat_qr" src="/images/wechat-reward.png" alt="Shaonbean WeChat Pay"/>
<p>微信打赏</p>
</div>
<div id="alipay" style="display: inline-block">
<img id="alipay_qr" src="/images/alipay-reward.png" alt="Shaonbean Alipay"/>
<p>支付宝打赏</p>
</div>
</div>
</div>
</div>
<div>
<ul class="post-copyright">
<li class="post-copyright-author">
<strong>Post author:</strong>
Shaonbean
</li>
<li class="post-copyright-link">
<strong>Post link:</strong>
<a href="http://itdevops.me/win10-hexo-github.html" title="win10+hexo+github搭建个人博客">http://itdevops.me/win10-hexo-github.html</a>
</li>
<li class="post-copyright-license">
<strong>Copyright Notice: </strong>
All articles in this blog are licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> unless stating additionally.
</li>
</ul>
</div>
<footer class="post-footer">
<div class="post-tags">
<a href="/tags/hexo/" rel="tag"># hexo</a>
</div>
<div class="post-nav">
<div class="post-nav-next post-nav-item">
<a href="/hexo-next-config.html" rel="next" title="hexo next 主题设置">
<i class="fa fa-chevron-left"></i> hexo next 主题设置
</a>
</div>
<span class="post-nav-divider"></span>
<div class="post-nav-prev post-nav-item">
<a href="/awesome-docker.html" rel="prev" title="Docker 进阶指南">
Docker 进阶指南 <i class="fa fa-chevron-right"></i>
</a>
</div>
</div>
</footer>
</article>
<div class="post-spread">
</div>
</div>
</div>
<div class="comments" id="comments">
<div id="disqus_thread">
<noscript>
Please enable JavaScript to view the
<a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript>
</div>
</div>
</div>
<div class="sidebar-toggle">
<div class="sidebar-toggle-line-wrap">
<span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
</div>
</div>
<aside id="sidebar" class="sidebar">
<div id="sidebar-dimmer"></div>
<div class="sidebar-inner">
<ul class="sidebar-nav motion-element">
<li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
Table of Contents
</li>
<li class="sidebar-nav-overview" data-target="site-overview">
Overview
</li>
</ul>
<section class="site-overview sidebar-panel">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image"
src="http://avatar.csdn.net/6/A/9/1_wh211212.jpg"
alt="Shaonbean" />
<p class="site-author-name" itemprop="name">Shaonbean</p>
<p class="site-description motion-element" itemprop="description">From Zero to the DevOps</p>
</div>
<nav class="site-state motion-element">
<div class="site-state-item site-state-posts">
<a href="/archives/">
<span class="site-state-item-count">16</span>
<span class="site-state-item-name">posts</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories/index.html">
<span class="site-state-item-count">12</span>
<span class="site-state-item-name">categories</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<span class="site-state-item-count">20</span>
<span class="site-state-item-name">tags</span>
</div>
</nav>
<div class="links-of-author motion-element">
<span class="links-of-author-item">
<a href="https://github.com/shaonbean" target="_blank" title="GitHub">
<i class="fa fa-fw fa-github"></i>
GitHub
</a>
</span>
<span class="links-of-author-item">
<a href="https://twitter.com/Ivyivyli" target="_blank" title="Twitter">
<i class="fa fa-fw fa-twitter"></i>
Twitter
</a>
</span>
<span class="links-of-author-item">
<a href="http://weibo.com/wh211212" target="_blank" title="Weibo">
<i class="fa fa-fw fa-weibo"></i>
Weibo
</a>
</span>
<span class="links-of-author-item">
<a href="http://blog.csdn.net/wh211212" target="_blank" title="CSDN">
<i class="fa fa-fw fa-globe"></i>
CSDN
</a>
</span>
<span class="links-of-author-item">
<a href="https://www.zhihu.com/people/vdevops" target="_blank" title="Zhihu">
<i class="fa fa-fw fa-globe"></i>
Zhihu
</a>
</span>
<span class="links-of-author-item">
<a href="http://www.jianshu.com/u/4e7e2ebc67d1" target="_blank" title="Jianshu">
<i class="fa fa-fw fa-globe"></i>
Jianshu
</a>
</span>
</div>
<div class="links-of-blogroll motion-element links-of-blogroll-inline">
<div class="links-of-blogroll-title">
<i class="fa fa-fw fa-globe"></i>
FriendSiteList
</div>
<ul class="links-of-blogroll-list">
<li class="links-of-blogroll-item">
<a href="http://www.aniu.tv/" title="Aniu" target="_blank">Aniu</a>
</li>
<li class="links-of-blogroll-item">
<a href="http://blog.csdn.net/wh211212" title="shaonbean" target="_blank">shaonbean</a>
</li>
<li class="links-of-blogroll-item">
<a href="http://www.baidu.com/" title="Baidu" target="_blank">Baidu</a>
</li>
<li class="links-of-blogroll-item">
<a href="/weblogs" title="Weblogs" target="_blank">Weblogs</a>
</li>
</ul>
</div>
</section>
<!--noindex-->
<section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
<div class="post-toc">
<div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#win10-hexo-github搭建个人博客"><span class="nav-number">1.</span> <span class="nav-text">win10+hexo+github搭建个人博客</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#参考以下步骤安装"><span class="nav-number">1.1.</span> <span class="nav-text">参考以下步骤安装</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装并配置环境"><span class="nav-number">1.2.</span> <span class="nav-text">安装并配置环境</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#注册github账号并创建一个以-github昵称-github-io-命名的仓库"><span class="nav-number">1.3.</span> <span class="nav-text">注册github账号并创建一个以 github昵称.github.io 命名的仓库</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装配置hexo"><span class="nav-number">1.4.</span> <span class="nav-text">安装配置hexo</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#自定义博客的相关信息"><span class="nav-number">1.4.1.</span> <span class="nav-text">自定义博客的相关信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置个人域名"><span class="nav-number">1.4.2.</span> <span class="nav-text">配置个人域名</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置部署"><span class="nav-number">1.4.3.</span> <span class="nav-text">配置部署</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置完成之后,现在可以进到设置的项目目录里面通过hexo部署到github"><span class="nav-number">1.4.4.</span> <span class="nav-text">配置完成之后,现在可以进到设置的项目目录里面通过hexo部署到github</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置博客主题"><span class="nav-number">1.4.5.</span> <span class="nav-text">配置博客主题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#参考链接"><span class="nav-number">1.4.6.</span> <span class="nav-text">参考链接</span></a></li></ol></li></ol></li></ol></div>
</div>
</section>
<!--/noindex-->
</div>
</aside>
</div>
</main>
<footer id="footer" class="footer">
<div class="footer-inner">
<div class="copyright" >
© 2017 -
<span itemprop="copyrightYear">2018</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">Shaonbean</span>
</div>
<div class="powered-by">
Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>
<div class="theme-info">
Theme -
<a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
NexT.Pisces
</a>
</div>
<div class="theme-info">
<div class="powered-by"></div>
<span class="post-count">Blog site total 92.0k words</span>
</div>
<div class="busuanzi-count">
<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span class="site-uv">
您是第
<span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
个小伙伴