百度博客注册(百度博客登陆)-第1张百度博客注册(百度博客登陆)-第2张

译者:咻咻ing

网志:https://xiuxiuing.gitee.io/blog

序言

那次讲了《为何杰出的开发人员都写网志?》那时要给我们增添咻咻ing的征稿,怎样构筑两个对个人网志。总之,除他们构筑除了许多杰出的诗歌创作网络平台。(CSDN,网志园,提前布局 ....)

采用Gitee+Hexo构筑对个人网志

为何采用Gitee而并非GitHub。

现阶段亚洲地区出访GitHub速度快,还可能将被墙,因此Gitee来构筑对个人网志。Gitee类似于亚洲地区版的GitHub,网络流量有确保。

自然环境明确要求

Git

NodeJs

预设你早已加装了Git 和 NodeJS (所推荐采用cnpm)

Git加装讲义:

https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137396287703354d8c6c01c904c7d9ff056ae23da865a000

Nodejs加装讲义:

https://www.runoob.com/nodejs/nodejs-install-setup.html

cnpm采用讲义:

https://xiuxiuing.gitee.io/blog/2018/08/25/cnpm/

百度博客注册(百度博客登陆)-第3张

开始构筑

1.加装Hexo

打开 shell 终端,输入命令:

npm install -g hexo

$ sudo cnpm install -g hexoPassword:Downloading hexo to /usr/local/lib/node_modules/hexo_tmpCopying /usr/local/lib/node_modules/hexo_tmp/_hexo@3.7.1@hexo to /usr/local/lib/node_modules/hexoInstalling hexosdependencies to /usr/local/lib/node_modules/hexo/node_modules[1/27] abbrev@^1.0.7installed at node_modules/_abbrev@1.1.1@abbrev[2/27] archy@^1.0.0installed at node_modules/_archy@1.0.0@archy[3/27] hexo-i18n@^0.2.1installed at node_modules/_hexo-i18n@0.2.1@hexo-i18n[4/27] js-yaml@^3.6.1existed at node_modules/_js-yaml@3.12.0@js-yaml[5/27] bluebird@^3.4.0installed at node_modules/_bluebird@3.5.1@bluebird[6/27] chalk@^2.3.1installed at node_modules/_chalk@2.4.1@chalk[7/27] hexo-front-matter@^0.2.2installed at node_modules/_hexo-front-matter@0.2.3@hexo-front-matter[8/27] minimatch@^3.0.4installed at node_modules/_minimatch@3.0.4@minimatch[9/27] pretty-hrtime@^1.0.2installed at node_modules/_pretty-hrtime@1.0.3@pretty-hrtime[10/27] hexo-util@^0.6.3installed at node_modules/_hexo-util@0.6.3@hexo-util[11/27] hexo-cli@^1.1.0installed at node_modules/_hexo-cli@1.1.0@hexo-cli[12/27] resolve@^1.5.0installed at node_modules/_resolve@1.8.1@resolve[13/27] strip-indent@^2.0.0installed at node_modules/_strip-indent@2.0.0@strip-indent[14/27] strip-ansi@^4.0.0installed at node_modules/_strip-ansi@4.0.0@strip-ansi[15/27] text-table@^0.2.0installed at node_modules/_text-table@0.2.0@text-table[16/27] tildify@^1.2.0existed at node_modules/_tildify@1.2.0@tildify[17/27] titlecase@^1.1.2installed at node_modules/_titlecase@1.1.2@titlecase[18/27] moment@^2.19.4installed at node_modules/_moment@2.22.2@moment[19/27] moment-timezone@^0.5.14installed at node_modules/_moment-timezone@0.5.21@moment-timezone[20/27] hexo-log@^0.2.0installed at node_modules/_hexo-log@0.2.0@hexo-log[21/27] swig-extras@0.0.1installed at node_modules/_swig-extras@0.0.1@swig-extras[22/27] lodash@^4.17.5installed at node_modules/_lodash@4.17.10@lodash[23/27] cheerio@0.22.0installed at node_modules/_cheerio@0.22.0@cheeriofsevents@1.2.4download from binary mirror: {"module_name":"fse","module_path":"./lib/binding/{configuration}/{node_abi}-{platform}-{arch}/","remote_path":"./v{version}/","package_name":"{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz","host":"https://cdn.npm.taobao.org/dist/fsevents"}[24/27] nunjucks@^3.1.2installed at node_modules/_nunjucks@3.1.3@nunjucks[25/27] swig-templates@^2.0.2installed at node_modules/_swig-templates@2.0.2@swig-templates[26/27] hexo-fs@^0.2.0installed at node_modules/_hexo-fs@0.2.3@hexo-fs[27/27] warehouse@^2.2.0installed at node_modules/_warehouse@2.2.0@warehouseexecute post install2scripts...[1/2] scripts.postinstall nunjucks@^3.1.2run"node postinstall-build.js src"[1/2] scripts.postinstall nunjucks@^3.1.2finishedin109ms[2/2] scripts.install hexo-fs@0.2.3› chokidar@1.7.0› fsevents@^1.0.0run"node install"[fsevents] Success:"/usr/local/lib/node_modules/hexo/node_modules/_fsevents@1.2.4@fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node"already installedPass --update-binary to reinstall or --build-from-source to recompile[2/2] scripts.install hexo-fs@0.2.3› chokidar@1.7.0› fsevents@^1.0.0finishedin306msdeprecate titlecase@^1.1.2no longer maintainedRecently updated (since2018-08-01):1packages (detail see file /usr/local/lib/node_modules/hexo/node_modules/.recently_updates.txt)2018-08-06→ resolve@1.8.1› path-parse@^1.0.5(1.0.6) (14:32:36)All packages installed (280packages installed from npm registry, used4s, speed1.65MB/s, json236(1.51MB), tarball5.8MB)[hexo@3.7.1] link /usr/local/bin/hexo@ -> /usr/local/lib/node_modules/hexo/bin/hexo

注:如果提示权限错误,命令前加sudo,cnpm 是淘宝的开源镜像,亚洲地区出访比npm快。

2.初始化Hexo

在你的电脑上创建Hexo文件夹,在shell终端中切换到Hexo目录,输入命令 hexo init

$ cd /work/Hexo/work/Hexo $ hexo initINFO Cloning hexo-starter to /work/HexoCloning into/work/Hexo...remote:Countingobjects:65, done.remote:Total65(delta0), reused0(delta0), pack-reused65Unpackingobjects:100% (65/65), done.Submodulethemes/landscape(https://github.com/hexojs/hexo-theme-landscape.git) registered for path themes/landscapeCloning into/work/Hexo/themes/landscape...^Cwarning: Clone succeeded, but checkout failed.You can inspect what was checked out withgit statusand retry the checkout withgit checkout -f HEADINFO See you again

初始化完成后Hexo的目录结构:

百度博客注册(百度博客登陆)-第4张

3. 获取网志主题

加装样式解析:npm install hexo-renderer-scss --save

$ npm install hexo-renderer-scss --save> node-sass@4.9.3install /Users/wang/HexoNew/node_modules/node-sass> node scripts/install.jsDownloading binary fromhttps://github.com/sass/node-sass/releases/download/v4.9.3/darwin-x64-64_binding.nodeDownload complete ░⸩ ⠋:Binarysaved to /Users/wang/HexoNew/node_modules/node-sass/vendor/darwin-x64-64/binding.nodeCaching binary to /Users/wang/.npm/node-sass/4.9.3/darwin-x64-64_binding.node> node-sass@4.9.3postinstall /Users/wang/HexoNew/node_modules/node-sass> node scripts/build.jsBinary found at /Users/wang/HexoNew/node_modules/node-sass/vendor/darwin-x64-64/binding.nodeTesting binaryBinary is fine+ hexo-renderer-scss@1.2.0added187packages from167contributorsandaudited3576packagesin24.221sfound0vulnerabilities

克隆主题:git clonehttps://gitee.com/xiuxiuing/hexo-theme-even themes/even

/work/Hexo$gitclonehttps://gitee.com/xiuxiuing/hexo-theme-eventhemes/evenCloningintothemes/even...remote:Counting objects:136,done.remote: Compressing objects:100%(123/123),done.remote:Total136(delta4),reused128(delta2)Receivingobjects:100%(136/136),264.27KiB|556.00KiB/s,done.Resolving deltas:100%(4/4),done.

克隆完成后,在/Hexo/themes目录下,可以看到 landscape和even 两个文件夹。

我们所要采用的主题都是放在这个目录下,Hexo预设采用的是landscape主题,由于第二步Hexo初始化时主题没有clone成功,因此我们这一步克隆了even主题,接下来会采用even主题进行演示。

想获取更多主题,可在网站:https://hexo.io/themes/ 选择他们喜欢的主题,按照此步的步骤clone下来。

4. _config.yml对网志进行基础配置

_config.yml文件修改,保存

百度博客注册(百度博客登陆)-第5张

5. 本地预览网志

编译项目,输入命令:hexo g运行项目,输入命令:hexo s

$ hexo gINFOStartprocessingINFO Files loadedin186msINFOGenerated: archives/2018/08/index.htmlINFOGenerated: archives/index.htmlINFOGenerated: archives/2018/index.htmlINFOGenerated: index.htmlINFOGenerated:2018/08/08/hello-world/index.htmlINFO5filesgeneratedin242ms$ hexo sINFOStartprocessingINFO Hexoisrunningathttp://localhost:4000/. Press Ctrl+Ctostop.

在浏览器中输入http://localhost:4000/`就可以看到效果啦

百度博客注册(百度博客登陆)-第6张

部署网志到Gitee上

1. 创建Gitee账号

到码云:https://gitee.com/ 上申请注册登记账号,码云类似于亚洲地区版的GitHub,因此操作界面跟GitHub差不多,多了一些国产化的东西,这里不做更多介绍了,他们研究下。

2. 创建项目

百度博客注册(百度博客登陆)-第7张

创建完成后,在项目中复制项目地址。

3. 在_config.yml中配置Git

deploy:type:gitrepo:https://gitee.com/xiuxiuing/blog.gitbranch: master

注意:冒号后面一定要有空格,否则不能正确识别。

4. 发布到Gitee

输入命令npm install hexo-deployer-git --save 加装自动部署发布工具

输入命令hexo clean && hexo g && hexo d 发布网志,首次发布需要在shell中输入账号和密码。

5. Gitee Pages设置

在项目的服务中选择Pages选项

百度博客注册(百度博客登陆)-第8张

选择 master分支,点击 部署/更新

百度博客注册(百度博客登陆)-第9张

稍等一会儿网志就发布成功啦,出访网志地址:https://xiuxiuing.gitee.io/blog,就可预览在线网志啦!!!

如果网志的样式不对,则需要在_config.yml中配置下网志地址和路径:

url:https://xiuxiuing.gitee.io/blog/root: /blog

再执行命令hexo clean && hexo g && hexo d 就可以啦。

至此,我们的网志就构筑完成。

在/Hexo/source/_posts目录下就可以写我们的网志。

早已成功在Gitee上构筑完成了他们的网志,但是这个网志还是比较简陋的。

接下来讲介绍 怎样开始诗歌创作 和 Even主题的常用配置 。

百度博客注册(百度博客登陆)-第10张

怎样开始诗歌创作

网志构筑完成,虽然功能很简单,但是早已可以开始诗歌创作。

新建文章

采用命令来新建一篇文章:

$ hexonew[layout] </code></pre><p id="6dc430a4-dca0-4726-89d1-8265fe30bdf3" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">layout 是文章的布局,预设为post,可以先不写。</p><p id="64c13636-e42e-4c6f-a1e9-4db755a219e9" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">title 是文章的标题,也是文件的名字,存储在source/_posts下。</p><pre id="94cc189a-a7b5-435f-ba82-3631b45dc667" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="499d0cf9-a10f-41ec-a77a-f704bf305ce0" style="font-size:18px;margin:20px 0px;text-align:left;">$ hexo<span id="ff461092-8151-4238-bfc1-e95d7a118f9f" style="font-size:18px;margin:20px 0px;text-align:left;">new</span>demo</code></pre><p id="644e78dd-5cab-4027-af3b-6263c5c0b532" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">则在source/_post目录下自动生成了demo.md文件</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/1535416302044ab3afe36a3?from=pc" style="width:100%;" /><p id="76a6facd-f451-4785-8d16-45f0368218dc" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">采用MarkDown编辑器打开文件就可以开始诗歌创作了。</p><p id="fdef0471-bd99-4d45-8ef5-830f5e326bdc" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="70b0f0d3-a5be-4dd6-9eaa-2548d4e6494e" style="font-size:18px;margin:20px 0px;font-weight:700;">Front-matter 设置</strong></p><p id="4f7c671e-9acb-4066-b04e-0ceacab4dccb" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">Front-matter 是文章最上方以 — 分隔的区域,用于指定文章的变量设置,举例来说:</p><pre id="841f54e5-1c88-44b0-a5b9-e6823280dda1" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="ab761c4b-037f-4460-9376-c7f73a7615d0" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="b180428d-9209-4404-92d0-a4f0a533bd25" style="font-size:18px;margin:20px 0px;text-align:left;">title: demo</span><span id="75bde72c-4e83-44be-abd4-7f830493606e" style="font-size:18px;margin:20px 0px;text-align:left;">date:</span><span id="21c0f669-25d9-470b-ade3-852e791fb97e" style="font-size:18px;margin:20px 0px;text-align:left;">2018</span><span id="14fcc126-d8c2-4e8f-95b1-6e1cc0ef637d" style="font-size:18px;margin:20px 0px;text-align:left;">-08</span><span id="cb0fb7d1-071e-4d6f-95d1-a6f8200ae824" style="font-size:18px;margin:20px 0px;text-align:left;">-23</span><span id="b736eee2-d91f-4f3a-854e-8c89983b3982" style="font-size:18px;margin:20px 0px;text-align:left;">15</span><span id="28e4ad43-72b1-4561-af39-2f225acd6846" style="font-size:18px;margin:20px 0px;text-align:left;">:13:30</span><span id="adce8c9a-00a5-461b-981e-57417ece64f5" style="font-size:18px;margin:20px 0px;text-align:left;">tags:</span><span id="56ea166e-d0c4-46f4-9ab6-c674ada4481c" style="font-size:18px;margin:20px 0px;text-align:left;">---</span></code></pre><p id="e3677f46-f53d-4e19-8067-dbc7cf8fc28c" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">以下是预先定义的参数,您可在模板中采用这些参数值并加以利用。</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/153541630382335e05dde94?from=pc" style="width:100%;" /><p id="23ef23b7-d2ab-4091-9f33-8313ea28ab7b" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="5db79ff4-3c26-4783-9f78-9bb29547dd72" style="font-size:18px;margin:20px 0px;font-weight:700;">文章分类和标签</strong></p><p id="b6962b55-b399-4727-a85a-f2de47da5983" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">只有文章支持分类和标签,您可以在 Front-matter 中设置。在其他系统中,分类和标签听起来很接近,但是在 Hexo 中两者有着明显的差别:分类具有顺序性和层次性,也就是说 Foo, Bar 不等于 Bar, Foo;而标签没有顺序和层次。在demo.md增加如下设置,示例:</p><pre id="63ef71e6-c901-44a4-8b4c-9a2e8a28f8f8" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="5ccf8c84-da51-49a6-9d4f-ac536f1a76f3" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="e4cca69d-bc1d-4878-b280-b76c6bbf0eb5" style="font-size:18px;margin:20px 0px;text-align:left;">categories</span><span id="8864cba2-7562-4631-b24f-534aec1c423f" style="font-size:18px;margin:20px 0px;text-align:left;">:</span><span id="f5ffdbdf-52de-46af-a803-5f117d267b5a" style="font-size:18px;margin:20px 0px;text-align:left;">-</span><span id="a59bc4cd-15a2-45e8-86bc-37a80dbcb6a0" style="font-size:18px;margin:20px 0px;text-align:left;">Demo</span><span id="0a94d544-7fa8-42b9-a144-8fb05660c5bd" style="font-size:18px;margin:20px 0px;text-align:left;">tags</span><span id="0dcf8718-aac0-4e6c-bd8a-591026569faa" style="font-size:18px;margin:20px 0px;text-align:left;">:</span><span id="f425ed8e-b805-4b54-9a86-cfbb3ca930e8" style="font-size:18px;margin:20px 0px;text-align:left;">-</span>示例</code></pre><p id="2b4c038d-8555-4d13-9200-868101c8bf2f" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">则会在网志的标签和分类下分别增加我们的配置效果:</p><p id="5af0e5a8-558e-4021-af9a-1785e03bd8b0" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">标签配置效果:</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/15354163041905ed017001c?from=pc" style="width:100%;" /><p id="c20da573-d4b0-45bf-a504-d4a12ced5456" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">分类配置效果:</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/1535416303015ce1dc4e941?from=pc" style="width:100%;" /><p id="23b72d43-6440-4ae3-85ca-7d77c7c09ebd" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">说明:文章分类和标签的设置,会自动归档的菜单的分类和标签中。</p><p id="e7d2c48d-9ce0-4421-b4fe-2bb0fb611647" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="210192b4-8466-491b-b7c5-32d64638c324" style="font-size:18px;margin:20px 0px;font-weight:700;">文章截断</strong></p><p id="e0a44442-3e03-4a40-ab4d-9103af924b34" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">在文章内容中添加 <!-- more --> 即可在首页显示时只显示其之上的内容。</p><p id="5206c35b-15c6-4aed-bdb4-fa96ee4d9c3f" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">并且会在 <!-- more --> 添加两个 Read more 的链接。</p><p id="2c09a738-7aa4-4b9f-8f14-1dd63390b8c7" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">如图:</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/1535416303398758790f8fc?from=pc" style="width:100%;" /><p id="ecffb673-5547-49fd-8480-6703931098b0" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="ecc03f81-2ce6-447c-9051-9279347a1b02" style="font-size:18px;margin:20px 0px;font-weight:700;">自定义文章简述</strong></p><p id="6d5dc629-d3a5-4353-ae65-4ab22b6f460d" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">可在文章头信息中添加 description 字段,并填写自定义的文章简述。</p><p id="58a09426-02df-4562-a71d-17310d16e46f" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">就可以在首页显示文章简述而不显示文章内容, 并自动添加阅读更多的跳转链接。</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/15354163026341ddaaae4bd?from=pc" style="width:100%;" /><p id="2afa65cf-a1d2-4df4-b7a1-dc77d9cfc74e" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">Even主题常用配置</p><p id="9c8c847e-ce4c-4ce4-a84f-fa21ea838877" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">我们网志构筑完成后Hexo的目录结构如下:</p><pre id="ea108a9d-b14c-4e12-acdb-57eb5be5a5be" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="18f46e5d-cbe9-465d-bbd3-fd1141359cab" style="font-size:18px;margin:20px 0px;text-align:left;">.├── _config.yml├── package.json├── scaffolds├── source<span id="9f3cf0e6-34a3-424e-8f4c-ce565ecf4c1c" style="font-size:18px;margin:20px 0px;text-align:left;">| ├── _drafts</span><span id="4f725846-6eb5-47ee-ac1b-7a341aa0af47" style="font-size:18px;margin:20px 0px;text-align:left;">|</span>└── _posts├── themes<span id="215fb458-7ee6-41a1-95e5-81265535e386" style="font-size:18px;margin:20px 0px;text-align:left;">| ├── even</span><span id="e2c0d6aa-48ba-413a-abdb-0545e816cd9e" style="font-size:18px;margin:20px 0px;text-align:left;">|</span>└── landscape</code></pre><p id="78d225e0-80eb-4f26-b80d-46034b5144d7" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">我们Even主题的配置则主要在even目录下进行,配置文件_config.yml,目录结构如下:</p><pre id="ca7359b6-e131-4343-a1d6-c463a5d73944" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="ccb20f03-c434-4a94-8c04-a8937927afd7" style="font-size:18px;margin:20px 0px;text-align:left;">.├── _config.yml├──<span id="6966a777-322d-4cb8-987c-7f07c6d38403" style="font-size:18px;margin:20px 0px;text-align:left;">package</span>.json├── scaffolds├── source| ├── css| └── js├── languages| ├──<span id="ca23cac7-99b4-4177-937b-17f2c694ee7a" style="font-size:18px;margin:20px 0px;text-align:left;">default</span>.yml| └── zh-cn.yml|── layout</code></pre><p id="df6bee8a-57b1-499c-a9c0-a9bcdcb82dfb" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="014099a4-bdb5-41a6-a24b-59731e52804b" style="font-size:18px;margin:20px 0px;font-weight:700;">修改主题颜色</strong></p><p id="de8abc18-26a4-40c0-b8d8-bdf67aee9b75" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">主题自带了 5 种可选的颜色:</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/15354163046308c496f9364?from=pc" style="width:100%;" /><p id="d7021ebc-2aac-4464-8377-3dd5e63fd1c7" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">修改主题配置文件中 theme 字段的 color 属性可改变主题色:</p><pre id="9779bb67-1933-4926-9a81-1f56ba1d20b4" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="32fe7bca-0668-457b-9d32-66a77b83f6e7" style="font-size:18px;margin:20px 0px;text-align:left;">===========================================Theme Settings===========================================theme stylingcolor:<span id="1aa2231b-5696-47af-b9d2-d6a0124d3ba3" style="font-size:18px;margin:20px 0px;text-align:left;">Default</span>| Mint Green | Cobalt Blue | Hot Pink | Dark Violettheme:color:<span id="8d32d73d-34d1-45ec-942e-20cc4fa7c564" style="font-size:18px;margin:20px 0px;text-align:left;">Default</span></code></pre><p id="c29e511d-6e22-408b-bee8-b58ba4872692" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">除能够修改为主题自带的 5 种颜色之外,还可以采用自定义的其他颜色。</p><p id="efa657b2-7cf7-4a6f-8058-f23da363c790" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><span id="1b7b8f20-d03a-47cd-bc39-2f92a1bc7afa" style="font-size:18px;margin:20px 0px;text-align:left;">在source/css/_custom/_custom.scss 中添加样式变量 $theme-color 修改主题色。</span></p><pre id="d091d504-46c2-4818-a388-0f2bb75fb523" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="d31dbaac-a81f-4041-b050-3e17113febf6" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="cd7d9758-d2ad-4846-927c-9019ecff65ee" style="font-size:18px;margin:20px 0px;text-align:left;">$theme</span>-color:<span id="2e10b3fa-c2b5-4fbd-a282-b5dd98701fd9" style="font-size:18px;margin:20px 0px;text-align:left;">xxxxxx;</span></code></pre><p id="3f974ca8-0584-4d50-8912-c12f7635b0fd" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">同时需要修改 $deputy-color 主题副颜色,该值主要采用在代码块背景以及文章目录。</p><pre id="acbe82ee-2ca3-45ce-9f37-f18e5d82087d" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="ed1a259c-4fdc-4d7f-99fb-fe3177036cd6" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="b4bfa5ad-04fa-426d-bcdf-d9c3a7de8896" style="font-size:18px;margin:20px 0px;text-align:left;">$deputy</span>-color:<span id="298685ef-1f1a-4544-9df0-7cb6001485e0" style="font-size:18px;margin:20px 0px;text-align:left;">xxxxxx;</span></code></pre><p id="219caaa1-59a5-4714-81ef-321bcd93274b" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">_variables.scss 中的样式变量都可以在 _custom.scss 中进行覆盖,从而自定义主题样式。</p><p id="43b69b55-d35d-42cb-b8d7-c20e44a23ff8" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="11dcd68a-1110-4e0f-bbfa-6d6fa7f36c09" style="font-size:18px;margin:20px 0px;font-weight:700;">添加分类页</strong></p><p id="6dc1c080-7621-4ac0-a993-0092c2e42261" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">采用命令新建两个 categories 页面:</p><pre id="69f83a52-2d3f-4a61-ab97-e32ccdb1b4bf" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="9737bf46-a721-4c85-a0f1-4e036561d0e8" style="font-size:18px;margin:20px 0px;text-align:left;">hexo<span id="d05761ec-b0f4-48ed-b122-5981e68a3b3d" style="font-size:18px;margin:20px 0px;text-align:left;">new</span>page categories</code></pre><p id="d61e28e8-01a0-4e82-982d-8c079cd6339c" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">编辑生成的 categories/index.md 文件,设置布局为 categories:</p><pre id="02bc3452-4e3f-4140-9374-8510b53965fc" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="38360faf-270d-46d3-bfd6-1ddbfe1932ec" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="0b871707-5cc3-4557-93f0-d2964384e6b7" style="font-size:18px;margin:20px 0px;text-align:left;">title</span>:<span id="2d23f2a9-fe41-4ec9-81f8-3b07cbfaa0c6" style="font-size:18px;margin:20px 0px;text-align:left;">categories</span><span id="587b3139-aa79-455e-a8bf-eb0b5a21d04f" style="font-size:18px;margin:20px 0px;text-align:left;">layout</span>: categories</code></pre><p id="d89dc606-3fc7-4169-93c0-e316d097212f" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">预设开启评论(如果采用了多说或 Disqus),添加 comments 字段并设置为 false 可关闭。</p><p id="30404a8e-a9d3-4309-b907-182af255a007" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">在主题配置文件(_config.yml)中添加链接:</p><pre id="22a948d0-80dd-413f-a2c8-86abe4021442" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="b398fac3-0da6-47e6-bf69-b243434f415a" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="121444b5-3a1d-4f12-a192-399c77101d88" style="font-size:18px;margin:20px 0px;text-align:left;">===========================================</span><span id="93cac02d-4792-4a5c-b787-be6be78afb6c" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="b89d5d5f-a7bc-4f40-8e55-9d5e8daf5bc3" style="font-size:18px;margin:20px 0px;text-align:left;">Menu Settings</span></span><span id="58b50a27-b42a-485f-b802-bab26e5c719b" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="16a059a0-5ea9-4ef7-97f4-c0c3b80af95e" style="font-size:18px;margin:20px 0px;text-align:left;">===========================================</span></span><span id="b92fab15-51e6-4fc0-9843-ea31e4c574d0" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="d8fca19b-769b-43a3-ac94-29589d0331d4" style="font-size:18px;margin:20px 0px;text-align:left;">menu:</span></span><span id="bc36c8f6-7e77-47aa-b650-fe8376cd3048" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="aafd1f5b-0455-4fec-842a-041655d1c252" style="font-size:18px;margin:20px 0px;text-align:left;">Home: /</span></span><span id="7323a3df-4890-4bf9-9426-cc246fd8e3ad" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="38d3cf6d-650a-4134-9223-52de663189dc" style="font-size:18px;margin:20px 0px;text-align:left;">Archives: /archives/</span></span><span id="3bf91f13-ea11-43c6-9dc3-d99a43169416" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="018d0a0e-905f-4715-999c-fbbb5262ec92" style="font-size:18px;margin:20px 0px;text-align:left;">Categories: /categories/</span></span></code></pre><p id="5865d646-2c38-41a4-abf4-0a63b8107f90" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="d7d46c7f-3323-4fed-b76d-cb0bc44d2185" style="font-size:18px;margin:20px 0px;font-weight:700;">添加标签页</strong></p><p id="36456a3f-30c2-4d40-97f7-104cddd6d739" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">采用命令新建两个 tags 页面:</p><pre id="f1f14d67-d2b5-4bbd-963d-2b071f892d16" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="f48d2f6f-a715-4f0b-8072-ca77f669f661" style="font-size:18px;margin:20px 0px;text-align:left;">hexo<span id="286d3433-1c95-4037-9ee5-8777179243f3" style="font-size:18px;margin:20px 0px;text-align:left;">new</span>page tags</code></pre><p id="6a957862-e069-45e7-8177-8c06eddd6c26" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">则会自动生成如下目录:</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/15354163047189db99df0ac?from=pc" style="width:100%;" /><p id="489f8180-1de2-461c-a5e6-c6cc259f4b76" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">编辑生成的 tags/index.md 文件,设置布局为 tags:</p><pre id="6921464e-76fe-402b-b838-42f2fc5bcf5b" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="3a5790ce-064e-4705-a78f-e3598b449a50" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="40a7effc-3caf-4f7c-a4b2-a3d1a6c8e94d" style="font-size:18px;margin:20px 0px;text-align:left;">title</span>:<span id="d49b9055-df99-4218-b463-bb26487a9bc7" style="font-size:18px;margin:20px 0px;text-align:left;">tags</span><span id="f1877807-efc6-4b74-addd-6d36234a809c" style="font-size:18px;margin:20px 0px;text-align:left;">layout</span>: tags</code></pre><p id="0aca0a14-7f86-4da3-8dd9-12be770e065f" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">预设开启评论,添加 comments 字段并设置为 false 可关闭。</p><p id="744f7469-220e-4707-ba23-7a855b009ab0" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">在主题配置文件(_config.yml)中添加链接:</p><pre id="851a85e7-2b88-4d57-a536-6a0f75ec0786" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="c46e6d9b-defd-4e41-b8fa-197e536987cc" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="36def139-64e2-46ed-b6f2-5c5b08016978" style="font-size:18px;margin:20px 0px;text-align:left;">===========================================</span><span id="2abc0d5e-0c02-4444-8653-3dc7513f6130" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="f2737910-8787-4491-8975-02d1ae45ccdb" style="font-size:18px;margin:20px 0px;text-align:left;">Menu Settings</span></span><span id="045782ac-81ab-4340-afbe-7482a6b401a9" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="6f0a8023-8050-4681-9ebe-d9d598a417ec" style="font-size:18px;margin:20px 0px;text-align:left;">===========================================</span></span><span id="b4ceaccd-c17c-44b5-94b8-418065437821" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="fd7bda97-e4c8-40ca-ae5b-b558883d5aad" style="font-size:18px;margin:20px 0px;text-align:left;">menu:</span></span><span id="f43d16f2-86f5-4178-b958-48dc2b06034a" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="d0a205be-88ba-40d9-85c9-1ff764007c57" style="font-size:18px;margin:20px 0px;text-align:left;">Home: /</span></span><span id="d64c7b78-fd4f-4e77-8598-c5bdca8b6389" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="481bebf0-6f8a-49f7-9e43-e83fefccec09" style="font-size:18px;margin:20px 0px;text-align:left;">Archives: /archives/</span></span><span id="e6612501-aba4-4d7f-9926-56271269bfac" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="7456df54-66ae-4afc-b0ca-30938c14e707" style="font-size:18px;margin:20px 0px;text-align:left;">Tags: /tags</span></span></code></pre><p id="8402021c-50f1-420c-8316-50c11e22a418" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="443bdf55-215e-464e-bbdb-b672e2758d76" style="font-size:18px;margin:20px 0px;font-weight:700;">添加自定义页面</strong></p><p id="7342bd0a-501c-4432-a182-44ca67f3ed90" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">采用命令新建两个自定义页面(以添加关于页为例):</p><pre id="68be1f5c-1c8b-47e9-999f-5efbd1895d8c" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="54dcbd67-5ce9-4de3-a64a-8e6b33ae046e" style="font-size:18px;margin:20px 0px;text-align:left;">hexo<span id="3f41be3c-bfad-4551-9d39-159bdedc756b" style="font-size:18px;margin:20px 0px;text-align:left;">new</span>page about</code></pre><p id="de19c255-8760-4830-8498-7a2a79736917" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">则会自动生成如下目录:</p><p id="17cb84c3-1489-459c-93a8-57a77f3708eb" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">编辑生成的 about/index.md 文件,设置布局为 page:</p><pre id="38b1c8de-0673-4a21-9c58-723d9473a79c" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="44f4c4cf-e345-416a-a330-819fa2b3c74f" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="a4dde2a8-edb5-4b24-94ac-d2918c2ac54e" style="font-size:18px;margin:20px 0px;text-align:left;">title</span>:<span id="0ca8a8ab-3212-4187-a087-45268853a4c7" style="font-size:18px;margin:20px 0px;text-align:left;">about</span><span id="80eb0143-28ab-4e0f-897a-56122926021b" style="font-size:18px;margin:20px 0px;text-align:left;">layout</span>: page</code></pre><p id="b79515fe-dddc-4f30-9ae5-5d5aa50e64a4" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">关于页面的内容,对个人相关介绍也是在此页面进行编辑。</p><pre id="a7a70aa9-f010-409d-9925-110df62e1b7e" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="a5416b7b-5d59-4971-93d7-e43dac36f65f" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="db5086e9-fb22-42ae-aef5-a879d7b47d33" style="font-size:18px;margin:20px 0px;text-align:left;">===========================================</span><span id="198e1b95-a985-4691-ac61-270329941afe" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="bf21438b-9f39-4162-a50d-fbc663d1bebd" style="font-size:18px;margin:20px 0px;text-align:left;">Menu Settings</span></span><span id="c0800c33-ea1a-4fd0-9268-1618a6af4566" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="01cd977d-c245-470f-8580-74056e1b79a3" style="font-size:18px;margin:20px 0px;text-align:left;">===========================================</span></span><span id="e1b0451f-875d-4914-95cf-c3af3fdf13fe" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="b2dbbfa0-aaa4-4ac3-b049-146365dbbcad" style="font-size:18px;margin:20px 0px;text-align:left;">menu:</span></span><span id="75f849e4-b6fb-4d69-bfc6-9b8ffcc246ff" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="eeaad479-f50e-4658-86c0-9caa94b1a34e" style="font-size:18px;margin:20px 0px;text-align:left;">Home: /</span></span><span id="49131c88-fe08-4a87-ae3d-556b1f88136b" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="5b1902e3-2045-4fc6-8bae-e3e5c2aa1258" style="font-size:18px;margin:20px 0px;text-align:left;">Archives: /archives/</span></span><span id="dcb9e236-af0e-432a-8e96-6530f2db7674" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="ff88a069-7398-4f88-82c4-70c9346300ac" style="font-size:18px;margin:20px 0px;text-align:left;">About: /about</span></span></code></pre><p id="0b310f0c-8b51-4328-ac8f-58e77029e6cc" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">在采用的语言文件下添加对应的字段(预设为 languages/default.yml):</p><pre id="4ec3d501-58db-4dab-842b-3cfd6e3ef7db" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="d43b2e05-af85-4cdb-b969-039e4ae899e0" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="7cc83a47-816d-44c9-995d-f42efa992875" style="font-size:18px;margin:20px 0px;text-align:left;">menu</span>:<span id="d8d1adc9-9930-43a3-834d-708e4892652a" style="font-size:18px;margin:20px 0px;text-align:left;">home</span>:<span id="65f060ea-6623-41e1-813f-a2edb8ba1849" style="font-size:18px;margin:20px 0px;text-align:left;">Home</span><span id="fa0d4ce7-9430-4bb7-b754-2d3f0f3be2a7" style="font-size:18px;margin:20px 0px;text-align:left;">archives</span>:<span id="e24de3ae-8a40-4091-87e8-1b70aab01f97" style="font-size:18px;margin:20px 0px;text-align:left;">Archives</span><span id="ed33d209-b9bd-491e-8ab0-7ef77727e138" style="font-size:18px;margin:20px 0px;text-align:left;">tags</span>:<span id="be02e820-ebdb-4fae-bf7e-351a4dc78af4" style="font-size:18px;margin:20px 0px;text-align:left;">Tags</span><span id="dc234e1a-0700-4fb8-8e80-45573f70e825" style="font-size:18px;margin:20px 0px;text-align:left;">categories</span>:<span id="778354f7-2de9-4e8d-860d-54e20fb2d907" style="font-size:18px;margin:20px 0px;text-align:left;">Categories</span><span id="0c2a31ff-c9c2-47fa-acf0-b18eab370d1e" style="font-size:18px;margin:20px 0px;text-align:left;">about</span>: About</code></pre><p id="9940ab66-bec2-43ff-9e2b-51909ccdcd4a" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">发布网志后,在首页的菜单中就可以看到我们设置的标签 分类 关于菜单啦!!!</p><p id="52270e82-4057-431a-bf61-6b41dc1845f8" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="bac382c9-3953-4cba-8aff-0c88bc6080f1" style="font-size:18px;margin:20px 0px;font-weight:700;">添加文章出访量统计</strong></p><p id="09c57e31-2a44-4e65-94dc-bd85c4f950ad" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">文章出访量 阅读次数 统计通过 LeadCloud 支持</p><p id="b78bd820-b212-41ea-a015-7eb3ca709069" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="684f3677-4dd6-46c2-8d84-883798281107" style="font-size:18px;margin:20px 0px;font-weight:700;">配置LeanCloud</strong></p><p id="2f27d4de-411d-431f-aebb-c0fbf1f4bcf5" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">打开LeanCloud官网,进入注册登记页面注册登记。完成邮箱激活后,点击头像,进入控制台页面</p><p id="9328069f-57db-45e4-8b10-c35abcbbb9c7" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="631aa5ca-3c77-427a-9bf6-edc903d08153" style="font-size:18px;margin:20px 0px;font-weight:700;">创建新应用</strong></p><p id="1f84ca17-73a7-4a5d-a7e0-39ea9b025244" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">创建两个新应用,并创建名称为 Counter 的 Class(注意权限选择无限制)</p><p id="8054b8c4-fac6-426b-847e-23555ba88425" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="2bc78352-4868-4239-8c2c-fe9ad42f1bd0" style="font-size:18px;margin:20px 0px;font-weight:700;">配置 app_id 与 app_key</strong></p><p id="0163b654-855d-4142-b876-32e2737bedaf" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">在你所创建的应用的 设置->应用Key 中查看 app_id 与 app_key</p><p id="d55b69d1-4db5-44a0-a17c-18e0ac1a4773" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">修改主题配置文件 _config.yml,填入 app_id 与 app_key:</p><pre id="f761380b-6808-4b6e-8dc1-9ee7a4de480e" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="b44a6c13-14c2-4a15-ae25-f1d2834b8983" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="e41b0cf2-075a-4809-8c4d-4bac5177b1e7" style="font-size:18px;margin:20px 0px;text-align:left;">LeanCloud</span><span id="723d20ed-9f99-4661-8d9a-13d2e356ae7e" style="font-size:18px;margin:20px 0px;text-align:left;">leancloud</span><span id="ae1f1eab-0808-4760-aa1f-5587bb62e8fb" style="font-size:18px;margin:20px 0px;text-align:left;">:</span><span id="0a0c277d-595d-48df-94bd-8b015bb569f8" style="font-size:18px;margin:20px 0px;text-align:left;">app_id</span><span id="0a524732-83ab-4dc6-ad55-00e626513d02" style="font-size:18px;margin:20px 0px;text-align:left;">:</span><span id="766c5387-fab6-407b-8bcf-7205d3caffc9" style="font-size:18px;margin:20px 0px;text-align:left;">app_key</span>:</code></pre><p id="a08fe7ef-d1ee-4cfb-94f2-0d27ebdea081" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="6e668077-3de0-4e95-aa0a-795d8b4f035e" style="font-size:18px;margin:20px 0px;font-weight:700;">设置 Web 安全域名</strong></p><p id="b334fe1c-4780-4b69-a972-a9c4d7febc0d" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">在你所创建的应用的 设置->安全中心 中设置 Web 安全域名 添加你的域名到 Web 安全域名中(若本地服务也想看到出访量,添加 http://localhost:4000/)</p><p id="f336628c-276e-495a-b5b3-4e9c582f0092" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="61ced91e-9a08-4e8b-a07f-e308f8d6c9d5" style="font-size:18px;margin:20px 0px;font-weight:700;">添加网志流量分析</strong></p><p id="59db2b97-a430-4d71-85df-f1a026364840" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">网志流量统计、访客地域分布、来源等数据统计通过 腾讯网站统计 支持</p><p id="4af104d1-7728-4dbd-bcf1-53110c550223" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="f82fa62c-fe6a-4be0-b833-85fcc9514d36" style="font-size:18px;margin:20px 0px;font-weight:700;">新增网站</strong></p><p id="30efd1be-26a3-46bf-98af-f2b6977438de" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">打开腾讯网站统计页面,注册登记相关账号信息,进入到管理页面,点击新增网站,填入相关信息:</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/1535416305194325360540e?from=pc" style="width:100%;" /><p id="050d729e-71a2-4a3a-a0cb-58848f1f8378" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="3550b312-c97d-4649-b48f-e64bae4be65d" style="font-size:18px;margin:20px 0px;font-weight:700;">代码获取</strong></p><p id="1ec1ecbb-0f10-412c-8268-5039ef9f7637" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">在代码获取页面获取到新版统计代码示例:</p><pre id="78ed5958-b031-4314-9785-5a527dc46015" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="4a110106-ea20-43c7-8bae-cb53a0227103" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="8d087cda-8220-4976-a01c-4931ab6fee10" style="font-size:18px;margin:20px 0px;text-align:left;"><<span id="bef0fdba-89ba-490c-9af0-9a39bf31dcfa" style="font-size:18px;margin:20px 0px;text-align:left;">script</span>></span><span id="29e31fc8-aba4-4b3d-b6a2-a4ded9e5f0cb" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="93c9d0c6-799f-4433-8847-70fb3ba7e862" style="font-size:18px;margin:20px 0px;text-align:left;">var</span>_hmt = _hmt || ;</span><span id="677eae04-3486-4e52-9f99-58767d3b3727" style="font-size:18px;margin:20px 0px;text-align:left;">(<span id="18c87734-e6e2-4062-b677-29f49155af0d" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="f71d6008-7e11-41ac-aa38-1b79fd2ba8f2" style="font-size:18px;margin:20px 0px;text-align:left;">function</span></span>{</span><span id="02c4adaf-cb14-4d7d-ab45-4d14422b3bdd" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="98a14ef4-232d-45ee-9ef8-f9a692db377d" style="font-size:18px;margin:20px 0px;text-align:left;">var</span>hm =<span id="d35c91b6-dabf-4a6d-a399-6b2152b4cc65" style="font-size:18px;margin:20px 0px;text-align:left;">document</span>.createElement(<span id="93d9c36f-0245-44ab-8e2a-98f85e5166a8" style="font-size:18px;margin:20px 0px;text-align:left;">"script"</span>);</span><span id="783ed780-476e-416a-aad4-d3fa73c462dd" style="font-size:18px;margin:20px 0px;text-align:left;">hm.src =<span id="ba779659-2c7f-4d71-a379-26d6b62afa23" style="font-size:18px;margin:20px 0px;text-align:left;">"https://hm.baidu.com/hm.js?6f2041754dc216e6973762726c19d178"</span>;</span><span id="7bca0958-e321-49d1-8dc6-2956bea24024" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="77f756ca-b5a9-412f-8588-4ae8763e4bf9" style="font-size:18px;margin:20px 0px;text-align:left;">var</span>s =<span id="89726f6d-b6a0-4219-923f-e6a0534a7e25" style="font-size:18px;margin:20px 0px;text-align:left;">document</span>.getElementsByTagName(<span id="005e625a-048a-499e-865b-b5858d7c3297" style="font-size:18px;margin:20px 0px;text-align:left;">"script"</span>)[<span id="ed917ab4-ae79-4c88-8939-067815b99208" style="font-size:18px;margin:20px 0px;text-align:left;">0</span>];</span><span id="cc88cc07-d4b7-4bc7-be60-a7d27bdb017e" style="font-size:18px;margin:20px 0px;text-align:left;">s.parentNode.insertBefore(hm, s);</span><span id="03964885-6827-42bf-9b64-bf5292f4df13" style="font-size:18px;margin:20px 0px;text-align:left;">});</span><span id="ef0c6846-f9f5-41cf-bff8-9f64382db731" style="font-size:18px;margin:20px 0px;text-align:left;"></<span id="5d759d42-7589-4227-9398-587f28367fbd" style="font-size:18px;margin:20px 0px;text-align:left;">script</span>></span></code></pre><p id="13e4d557-099e-4d6d-97db-f8890fcdfc47" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><span id="9fb216e5-0752-481a-ab2d-466e1136e755" style="font-size:18px;margin:20px 0px;text-align:left;">其中的6f2041754dc216e6973762726c19d178类似于我们腾讯统计分析的APPID。</span></p><p id="3b491018-6ae7-472b-bdd5-265023eeaeb1" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="c96dbf64-c8a1-4672-aa8e-91a213aee403" style="font-size:18px;margin:20px 0px;font-weight:700;">配置腾讯统计APPID</strong></p><p id="71363b05-74ad-4f59-86a6-363363a4d762" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">修改主题配置文件 _config.yml,填入 APPID:</p><pre id="31709f5c-3ddf-43e4-910d-6ccf7ea9a1ba" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="504c7fe0-e2b6-4a4f-a186-bfc3a87860a6" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="5eebad49-1bec-4272-b74a-41c1310c6e7f" style="font-size:18px;margin:20px 0px;text-align:left;">Baidu Analytics</span><span id="a10c9586-dc01-4b8e-ab22-773cfe1414ba" style="font-size:18px;margin:20px 0px;text-align:left;">baidu_analytics: 6f2041754dc216e6973762726c19d178</span></code></pre><p id="6f0da710-895b-4be0-9961-4e8665a569a1" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">配置完成后执行hexo -g hexo -d编译发布我们的网志。</p><p id="2a89b2ca-5d81-4b7a-8210-dc465c0091f4" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">可以在腾讯统计分析的代码加装检查页面,点击检查,判断我们的腾讯分析是否添加成功。</p><p id="a4124d34-6417-4a6c-9ffd-d91caf771113" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">添加成功后,差不多20分钟后就可以看到腾讯统计后台的数据了.</p><img src="https://p3.toutiaoimg.com/origin/pgc-image/1535416306020b413d57bfd?from=pc" style="width:100%;" /><p id="4fc60ed3-5c51-4d1b-a5d7-70e95939ddd8" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="48790885-8a82-4f79-9b28-fc925dc65f13" style="font-size:18px;margin:20px 0px;font-weight:700;">设置文章打赏</strong></p><p id="4ca9c94c-0ef9-41b0-b7fe-ee4b88cb816e" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">通过主题配置文件中的 reward 字段开启/关闭:</p><pre id="bfd8393e-c114-4786-924b-c4e1d0c7b4ba" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="699cec92-0e6e-407a-a99d-b167c201096f" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="85923903-7f4d-4775-bf27-a24cf47be52a" style="font-size:18px;margin:20px 0px;text-align:left;">reward</span>:<span id="992484fa-82c6-4295-93dc-f9462d1e9c11" style="font-size:18px;margin:20px 0px;text-align:left;">enable</span>:<span id="903a038d-6d4b-4755-bb14-d36f97941610" style="font-size:18px;margin:20px 0px;text-align:left;">true</span><span id="eb73c772-63ad-44fc-87fd-c80c1438e660" style="font-size:18px;margin:20px 0px;text-align:left;">qrCode</span>:<span id="0307d214-915c-4ea0-8f9b-ff391d6b1ba7" style="font-size:18px;margin:20px 0px;text-align:left;">wechat</span>: /image/reward/wechat.<span id="1161fdf0-4a21-4ec8-99b7-2def4229ce03" style="font-size:18px;margin:20px 0px;text-align:left;">png</span><span id="67374a06-edba-43f7-aa53-b308e0f62ea3" style="font-size:18px;margin:20px 0px;text-align:left;">alipay</span>: /image/reward/alipay.png</code></pre><p id="643c7179-8645-4951-b926-8c7614400206" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">支持微信以及支付宝,修改 qrCode 下对应的二维码图片链接,也可以直接设置成图片的网络链接。</p><p id="4527db6d-0df4-4ce6-b90e-0658cace5b6d" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">当开启打赏功能时,可通过文章 Markdown 头部:</p><pre id="871e6516-fe29-45b3-a370-f53c3610307b" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="38bb493e-13bb-4db5-a625-ee7a5f778215" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="dce406e9-0ff6-434c-bb6a-0712c1b904e4" style="font-size:18px;margin:20px 0px;text-align:left;">reward:</span><span id="dfd9cc22-b618-43e7-b8b2-b2e4d3ab5503" style="font-size:18px;margin:20px 0px;text-align:left;">false</span></code></pre><p id="f86318c3-9d22-430c-943f-75769184ce3f" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">关闭该篇文章的打赏。反之,当打赏功能关闭时,可以在文章中单独开启。</p><p id="3c03f7c8-6dbc-4de1-bff0-f0822e0f0908" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="1949b47d-b7c0-4796-8225-ab6c7d170c23" style="font-size:18px;margin:20px 0px;font-weight:700;">设置底部社交链接</strong></p><p id="6c83b2ea-904f-40c8-a583-6ed966f35b7e" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">现阶段支持:Email, Stack Overflow, Twitter, Facebook, Github, 微博以及知乎</p><p id="89569c55-5a06-445d-863f-3303e14f0924" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">修改主题配置文件中的 social 字段下的各个字段开启,为空时即为关闭:</p><pre id="df0f812d-bcc7-4e5f-b1a4-9a73e4543b88" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="c5f5f12a-534e-4ebf-8272-a6dcbcf287a5" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="191132e7-4c02-47a0-8450-dc25f6941b2f" style="font-size:18px;margin:20px 0px;text-align:left;">social</span>:<span id="2ba25c48-35f1-4a40-b8f7-6737e3e10986" style="font-size:18px;margin:20px 0px;text-align:left;">email</span>: your<span id="6e2d1053-da9e-4897-bff3-e33056c35987" style="font-size:18px;margin:20px 0px;text-align:left;">@email</span>.<span id="c347a2e1-d8e9-4978-84c6-c2368e2cf7dd" style="font-size:18px;margin:20px 0px;text-align:left;">com</span><span id="d7bd2da4-d40d-4d22-ae90-001f2c59f832" style="font-size:18px;margin:20px 0px;text-align:left;">stack-overflow</span>:<span id="e77515ac-15e7-4fab-ac71-1f17fafe0a8c" style="font-size:18px;margin:20px 0px;text-align:left;">twitter</span>:<span id="90b51a4b-346f-4f20-b06d-bce213756013" style="font-size:18px;margin:20px 0px;text-align:left;">facebook</span>:<span id="c7a6af92-edee-413f-963b-e952e1742ef4" style="font-size:18px;margin:20px 0px;text-align:left;">github</span>:<span id="a1b22a77-693d-47e8-81c8-794dec98ce03" style="font-size:18px;margin:20px 0px;text-align:left;">weibo</span>:<span id="a673e2bd-3d26-47c6-83c1-4598232170b6" style="font-size:18px;margin:20px 0px;text-align:left;">zhihu</span>:</code></pre><p id="c442fe89-4f1c-4546-978b-17d031423265" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">主题采用的是自定义的 iconfont 图标库。</p><p id="aec7a61a-b29d-417e-9409-70a9a238ef65" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><strong id="ce8cb1c2-9594-4a20-8f25-97b80685cf22" style="font-size:18px;margin:20px 0px;font-weight:700;">设置文章版权</strong></p><p id="f3b53b41-3983-4ac8-82c5-3560a4c6a9a7" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">修改主题配置文件中的 copyright 字段开启/关闭:</p><pre id="e1126af2-be0d-4c6f-b720-4dd1e4a5d2d6" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="d48493dd-cfa1-4ad4-9af4-f25cba3b1bb5" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="172193ad-b753-4a62-b231-bf44b0f461ca" style="font-size:18px;margin:20px 0px;text-align:left;">copyright</span>:<span id="11da9696-7c29-4430-8781-a3c52cbfeb9c" style="font-size:18px;margin:20px 0px;text-align:left;">enable</span>: true<span id="7c3c0756-94d1-41a4-b42b-300022a9ac8a" style="font-size:18px;margin:20px 0px;text-align:left;">https</span>:<span id="772afdcf-16c6-445a-a0cb-65dc10f1b5a9" style="font-size:18px;margin:20px 0px;text-align:left;">//creativecommons.org/</span><span id="97ec36eb-803c-4106-bc43-0fd28fafce46" style="font-size:18px;margin:20px 0px;text-align:left;">license: 本文采用<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">知识共享署名-非商业性采用 4.0 国际许可协议</a>进行许可</span></code></pre><p id="84ddf218-52d7-4c73-ab0e-9beafacb4c0b" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">预设显示译者,来源,链接以及版权说明,版权说明可通过 copyright.lincese 自定义。</p><p id="edee1d4a-7cda-4f2d-b063-b25122075c46" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">copyright.license 的值可以是 HTML</p><p id="a1ad3aa6-7276-4bc5-bc8b-755ba89a1347" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">当文章版权信息开启时,可通过文章 Markdown 头部:</p><pre id="cd734982-9701-42ec-bd14-6c2b0c59b18f" style="font-size:18px;margin:20px 0px;text-align:left;"><code id="f1b34d6c-90e5-4839-ac09-ad5dec156c5d" style="font-size:18px;margin:20px 0px;text-align:left;"><span id="91bf30ef-eec8-445d-a96c-fb96ae23cf92" style="font-size:18px;margin:20px 0px;text-align:left;">copyright:</span><span id="9474ce1d-9240-467f-909e-eb15a1c6a698" style="font-size:18px;margin:20px 0px;text-align:left;">false</span></code></pre><p id="1c5619a7-8f22-4096-8865-e569e0b22f70" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;">进行单篇文章版权信息的关闭。</p><p id="619ef1e9-1579-4ffd-9c8b-f6366e9a40e0" style="font-weight:400;text-align:left;line-height:1.667;margin:20px 0px;font-size:18px;"><span id="a3f64f98-1d36-4aae-9813-e5efe3b421a4" style="font-size:18px;margin:20px 0px;text-align:left;">对个人网志效果参考:https://xiuxiuing.gitee.io/blog/</span></p></body></html>