title: 个人博客站点建设历程 date: 2015-08-20 categories: - 术业专攻 tags: - GitHub - Hexo - WordPress - JavaScript - Markdown - HTML - CSS - jQuery permalink: blog-building top: 1 ---

前言

本篇日志用于归纳记录自己在学习建设个人博客站点中的各种尝试和思考。   为方便编辑和查看最新进展,更新以倒序方式呈现。 > 大部分改动最终会同步到 [Yelee][56] 主题中,希望主题用户能偶尔查看此日志,按需决定是否更新;
- 使用上的问题可先查阅文档 [《Yelee 主题使用说明》][162a] - 改动和尝试中参考的主要资源都做了 [链接跳转]() 并在文末列出; - [[G]](): 表示该项的具体修改已 commit 提交到 [GitHub][0.1],点击即可查看; [0.1]: https://github.com/MOxFIVE "MOxFIVE's GitHub" ## 2016 年 7 月 ### 07-04 目录设置 > - [[G]][166] 调整完善目录设置,方便显示\隐藏文章序号和限制目录最大级数(层级太多目录区会显得臃肿)。 [166]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/659f6eabe4922699a69bc583404c9f778b896535 "add: settings for TOC (list_number, max_depth)" ## 2016 年 6 月 ### 06-30 标签标题切换 > - [[G]][165] 合并 Pull,支持在切换标签页时更改其标题,挺有意思的小功能。 [165]: https://github.com/MOxFIVE/hexo-theme-yelee/pull/117 "feat: tab title change when switch tab | 切换标签页时更改标签页标题" ### 06-27 评论数显示 > - [[G]][164] 可以在主页文章标题旁显示评论数(多说 或 Disqus) [164]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/865a26bbcce2c173534653e2ee6ea201a22fe6ff "feat: show comment count on home page" ### 06-25 新标签设置 > - [[G]][163] 完善新标签打开页面的设置,现在可以分别指定哪些类型页面在新标签中打开; > - [[G]][163a] 添加几个社交图标(LOFTER, Coding, Quora, bilibili, AcFun, niconico) [163]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/6416f538e5ee70a84a0dbddfc44a5b6a53fdfbc8 "add: settings for "open in new tab"" [163a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/a0f31a3acae4a7333439c450b4b8994ca6c09e5d "add(social-icon): LOFTER, Coding, Quora, bilibili, AcFun, niconico" ### 06-17 主题文档 > - [[G]][162] 主题发布 v3.5 版本,也终于弄好说明文档了,希望大家能更新,以后有疑问可先查阅文档: [《Yelee 主题使用说明》][162a] [162]: https://github.com/MOxFIVE/yelee [162a]: http://MOxFIVE.coding.me/yelee ### 06-14 样式调整 > - [[G]][161] 调整部分区域的阴影效果和文字样式; > - [[G]][161a] 去掉几张默认背景图。 [161]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/621e98914b1ba14aa9878ef5fe9a3ab47f3a2851 "style: box-shadow, color, font-size" [161a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/d9735d76ab21914f9db8d6a92cec3bd04a98a009 "style: change default background images" ### 06-11 ISSUE 模板 > - [[G]][160] 提 issue 前希望能阅读下推荐的短文,总结得挺好的 [提问的检查表](http://t.cn/R5tOIdv)。 [160]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/6e0139c81dbaecdeed4419e3e085b862814cb934 "doc: add ISSUE_TEMPLATE" ### 06-08 动态加载评论 > - [[G]][159] 现在可以选择动态加载评论模块,即当点击评论条时才显示评论内容。 [159]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/cc7eff47d0368f94fc9541d9d70154be500e8b6d "feat: load comment section dynamically 动态加载评论模块" ### 06-05 可折叠目录 > - [[G]][158] 多级目录现在可以被展开和收起,方便浏览。同时对目录相关的代码进行了大量优化; > - [[G]][158a] 目录不换行时,使用更合理的方式显示标题提示。 [158]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/85764bbf482c78d819f8ca87bf9fe390d523dd3b "feat: collapsible TOC 可折叠目录" [158a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/6b1f010ccc781793bcce0c750d50fc9f4fe25f80 "refactor: TOC nowrap" ### 06-04 样式优化 > - [[G]][157] 经提醒修复边栏标签云显示溢出的问题; [157]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/73ea4ac7144992c4dca3581cba99e82a6d42b41b "fix: tag cloud displays incompletely in sidebar" ### 06-02 图片压缩 > - [[G]][156] 压缩优化主题中的图片。 [156]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/eb416b5b064bbeb332214df0440f40e046b78588 "style: compress images" ### 06-01 头部标签 > - [[G]][155] 补上一些常用的 HTML 头部标签,顺便统一代码缩进风格。 [155]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/1231c1178d7dbd23b3d269b79947b0139d1a97bc "refactor: HTML Meta Tags" ## 2016 年 5 月 ### 05-27 代码优化 > - [[G]][154] 修复未启用 jQuery UI 时搜索功能会失效的问题。 [154]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/7c57db8257868274e2d1ec1610b33ccb83276ed3 "fix: local search fails to load when tooltip is disable" ### 05-26 代码优化 > - [[G]][153] 移动端不再加载多余的 jQuery UI, 首屏加载小了 100k; > - [[G]][153a] 修复迷你归档按钮切换问题。以前选择器选得太笼统了; > - [[G]][153b] 升级依赖版本。因为不会去兼容 IE6-8,所以 jQuery 直接升到了 2.2.4。 [153]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/07e495813917d7db8cec5b5e2c96ca1d8154ffcb "fix: load jQuery UI until it is needed" [153a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/9065e15cb9892181786d53ee43c1635236c7f761 "fix: miniArchives button" [153b]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/6242ff752356e7ecef205caf558481b5a19bb497 "update: jQuery 2.2.4, RequireJS 2.2.0, Font Awesome 4.6.3 ..." ### 05-25 本地搜索 > - [[G]][152] 添加本地站内搜索功能。配置基本完善,再装个插件就能用,终于不用再折腾各种第三方搜索服务了。 [152]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/0280f6a17d1a0fa1f52056856082e022dfac220c "feat: Local Site Search | 本地站内搜索" ### 05-23 IE 升级提示 > - [[G]][151] 现在使用 IE6/7/8 访问博客时将跳转的指定的页面; [151]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/7814a79f11b824182a49762bd48c2481c0b0ac92 "refactor: Update Reminder for IE6/7/8" ### 05-21 主题版本 > - [[G]][150] 配置文件和页脚 Yelee 的提示文字中添加主题版本信息,方便讨论; > - [[G]][150a] 补充发布了从 1.0 到 3.0 共五个版本的主题。这么久了还能补上更新日志,多亏了自己明晰的 Commit 记录。 [150]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/31675d5d76e2272fafa258e0fffb0a44aeff9dbf "add: Theme Version 主题版本显示" [150a]: https://github.com/MOxFIVE/hexo-theme-yelee/releases ### 05-19 边栏点击 > - [[G]][150] 修复 PC 端单栏模式下不能点击展开侧边栏的问题,同时边栏使用 `flex` 布局以兼容 `max-width` 属性。 [150]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/fd08519060a741640db6045998ed4ae74f8d80cc "fix: show mobile slider on PC | 边栏点击展开" ### 05-18 标题风格 > - [[G]][149] 优化标题相关代码,同时添加两种标题风格(Yilia, GitHub),喜欢极简的可以换用。 [149]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/f9fbf55c7698c3950846cce59af9c5262329d52a "refactor: add 2 heading styles 标题风格" ### 05-17 图片压缩 > - 添加压缩优化背景图的说明,曾提过一次,但感觉不少用户并没有注意到,索性写了篇 [小教程][148]。 [148]: http://moxfive.xyz/2016/05/17/image-compression/ "关于 Yelee 主题背景图的压缩与优化" ### 05-16 标签底色 > - [[G]][147] 优化标签背景颜色相关代码,同时换用对比度更高的底色。 [147]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/967214e8a024a0a5604b88ab7d66772125e20e05 "refactor: background color of labels" ### 05-15 IE 升级提示 > - [[G]][146] 主题 IE6/7/8 下样式错乱,不打算兼容了,访问时会直接全屏提示升级浏览器。 [146]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/6c91bedd2e6179abfe36bd41a2b3ad70798719bf "add: Update Reminder for IE6/7/8" ### 05-07 列表样式 > - [[G]][145] 优化列表相关代码,同时新增 12 种列表标记样式。1-3 号标记为 CSS 默认样式,排版兼容性较好;其余通过伪元素控制,兼容性欠佳但样式较灵活。 [145]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/06a840631f4586e3bdaa184bbaa674fa95aeffd3 "refactor: add 12 list styles 列表样式" ### 05-03 社交图标 > - [[G]][144] 新添加 CSDN, 博客园等几个社交图标供选用; > - 更新主题介绍文档图片链接,HTTPS 链接的图片似乎有点问题。 [144]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/41beb86dd348c659bec430339842561f74e16d28 "add(social-icon): Plunker, CodePen, 博客园, CSDN" ## 2016 年 4 月 ### 04-27 样式优化 > - [[G]][143] 完善移动端边栏翻译; > - [[G]][143a] 调整使用 Hexo 标签插件时引用区样式; > - [x] [[G]][143b] [[G]][143c] 支持通过 `- [x]` `- [ ]` 添加复选框任务列表。只是一个临时的前端方案,还是希望相关 markdown 解析器能原生支持; > - [[G]][143d] 更新文档图片链接,贴图库感觉不大稳定。 [143]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/3c02de2deef03b2367f4b3082223b65d1911dcfa "style: translate mobile slider" [143a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/ee94e78b470bbfdc09a3a0fd68ac2ad725531bd4 "style: block quote with tag plugin" [143b]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/3d4ddb74250d72f47876364b0e467a05b65ce8a6 "feat: Task Lists in markdown | 复选框支持" [143c]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/e922391c734167dd0b5f38ed1290fc84ee6c8b15 "style: Task Lists" [143d]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/f2d3418b0aa2e790e3d0ff5f3ce51e234f9267f2 "doc: update images' links" ### 04-24 样式优化 > - [[G]][142] 可在页脚显示网站成立年份; > - [[G]][142a] 调整标签云页面样式,同时完善其翻译。 [142]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/5b8b95628f71bf99b5cea20fa3aadd8ebd7ccc61 "add: "since" year in footer" [142a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/e8de63242dbeff039c00ebac0c1401228515f869 "style: translate tag cloud page" ### 04-20 代码优化 > - [[G]][141] [[G]][141a] 精简百度分享和社交图标栏代码; > - [[G]][141b] [[G]][141c] 调整页脚和边栏副标题样式; > - [[G]][141d] 目录不分行时显示省略号。 [141]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/9e9ab4d381abe1a704f8d6058d34faf0ce3bb512 "refactor: Baidu Share" [141a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/f722d10a2254576a436b94533854ca42095dc06b "refactor: social icon bar" [141b]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/4d875cb7ace474f8024949b6338f015e3639f8ec "style(footer): add 2 icons" [141c]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/22f50c9fddc91c4beeba12fd05004cf938ac331d "style: footer, header-menu" [141d]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/b25814d0a85b01de9fc9b7badf44c80735a9fd83 "style(toc): nowrap, ellipsis (…)" ### 04-18 字体修复【重要】 > - [[G]][140] 修复字体搭配失效导致文字黯淡发虚的问题。一个小错误让主题在 Windows 下的显示效果大打折扣; > - 顺便统一了边栏字体,加粗文章各级标题。 [140]: https://github.com/MOxFIVE/hexo-theme-yelee/issues/78 "字体可能会黯淡发虚有锯齿,请主题用户更新字体设置!" ### 04-17 图标优化 > - [[G]][139] 修复首页首篇文章过长时页面空白的问题; > - [[G]][139a] GitHub 更换 SVG 格式图标,既提高了清晰度又避开了之前图标不显示的问题; > - [[G]][139b] 调整样式代码,以换用清晰度更高的 logo 图片。 [139]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/83692772e1b00a220db25223120b4d6f2fc5ef55 "fix: articles are invisible until scrolling down in homepage" [139a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/938b8470b32097e40281cfc64a2a8f9bc79fcb36 "style:SVG logo for GitHub" [139b]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/acc93bb6083cd0281ee6b9b72e53a8408dfafa74 "refactor: HD logo image 高清图标" ### 04-15 CDN 加速 > - [[G]][138] [[G]][138a] [[G]][138b] Font Awesome、clipboard.js 和 fancyBox 都使用 CDN 引入,精简代码和本地资源,同时加快页面二次加载速度; > - [[G]][138c] 主题配置中关联 CDN,方便切换。 [138]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/0c7a3e95a54699988ba37d495f2338ee14a7e33c "style: load Font Awesome via CDN" [138a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/aeff547702acc636218387b25c739dac7463ce04 "style: load clipboard.js in head via CDN" [138b]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/456ae19bc0288ce2237f0ab65fba84a3ab9fac8e "style: load fancyBox via CDN" [138c]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/270bb3ad0628fecd5e68be064b06dd2a1c2e0e55 "add: variables for CDN" ### 04-13 字号调节 > - [[G]][137] 通过 rem 和 Stylus 变量,快速调节字号和缩放页面元素。用了 rem 这个单位,主题大概是真的不支持 IE678 了; > - [[G]][137a] 调整移动端文字、标题、行距、边距、版权信息区等样式,布局更紧凑,文字更突出。 [137]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/53a83a13cb0145456928d86c0b144e3c1d228e04 "feat: rem layout/font-size 字号调节/页面缩放" [137a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/576419fbd4bdfe98dcbf5f6ea4a31c175010ee7c "style(mobile): font-size, line-height, margin, padding..." ### 04-03 字体优化 > - [[G]][136] 加深默认字体颜色,添加参数调整文本渲染效果; > - [[G]][136a] 优化 Font Awesome 图标在 Chrome 等浏览器下的显示效果。 [136]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/8be2b796bc7dbe35d8da337993297806378b9a1e "style(font): color & rendering" [136a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/730f6f2966d6e172c22669b51d3735c454bb07bd "style(FontAwesome): font-smoothing" ### 04-02 分享优化 > - [[G]][135] 优化百度分享代码,同时将图标替换为 Font Awesome 字体,看着和谐多了; > - [[G]][135a] 添加 AddThis 分享。相比百度,AddThis 默认样式美观不少,而且可以在 HTTPS 站点中使用。 [135]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/20b2e4f7296c945d4039c358841d45d906f5fe4f "refactor: Baidu Share 百度分享优化" [135a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/4017757cdb52be40b361b1e38397d21805400d79 "add: Share Tool "AddThis"" ### 04-01 代码优化 > - [[G]][134] 修复网站位于子目录时 main.js 失效的问题; > - [[G]][134a] 当 GitHub.png 不存在时,使用 github.png 作为图标。不少用户更新后 GitHub 图标不显示,虽然可以甩锅给 Git, 还是在主题里做一下兼容好了; > - [[G]][134b] 修改文本框文字颜色,相对清晰些; > - [[G]][134c] 左边栏设置最大宽度,改善其在平板下的显示效果。 [134]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/3b90b3adb0471a1297a70f4cda86202dc29f9a2e "fix: subdirectory support" [134a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/048905522c336491a7a48879d91984e0538fc582 "fix: case sensitivity of GitHub.png" [134b]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/56336d6c851c2223537897e5de61cebde2856cbf "style(text-block): text color" [134c]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/784f3e2d5b19ba0de5e77e4592e621b0441a652a "style(mobile-slider): max width" ## 2016 年 3 月 ### 03-30 代码高亮 > - [[G]][133] 关掉 Hexo [代码类型检测](https://hexo.io/news/#Lazy-load-language-files-of-highlight-js),手动指定代码语言,避免生成各种奇怪的高亮样式。 [133]: https://github.com/MOxFIVE/Markdown-Archives-Backup/commit/0ba2cbc3df33b17edec3a06fe6fe15a31c4158ee "update: 手动指定代码类型" ### 03-23 样式调整 > - [[G]][132] 调整页面进度条的默认样式,天蓝色带点阴影; > - [[G]][132a] 修复友情链接内容显示不全的问题,同时微调其样式; > - [[G]][132b] 主题文档中添加切换语言的说明。 [132]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/dd6fd7ea02bc1d7d913b4d510ceb730de7694b86 "style(.pace-progress): default color & box-shadow" [132a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/0183e6ada5dc49153ab52f1d2d52d4434c800e8f "fix: add scroll-bar to friends-link part" [132b]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/94f4f53e94797766f83c66ea77ba92268cced9b0 "doc: Internationalization | 语言切换" ### 03-21 翻译完善 > - [[G]][131] 完善文末版权区的翻译,同时为了保证切换语言后显示一致,对部分样式进行了调整。 [131]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/6ee2f8a64769e61ffe3f8ea9ee84261276c2d3d7 "style: translate copyright info." ### 03-20 多语言支持 > - [[G]][130] 主题添加多语言支持(简体中文 | 港澳繁体 | 台湾正体 | 英语),配置中未指定语言时默认使用简体中文。个人语言水平有限,欢迎协助完善翻译; > - [[G]][130a] 页面中加入语言声明; > - [[G]][130b] 修复 阅读全文 按钮移动端内边距设置无效的问题。 [130]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/c38f2e103d8760478d849769eef6f503a767b6ff "feat: i18n, multi-language support 主题多语言支持" [130a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/a288bdada984d5d6553c80e7953bd9153e05ffaa "style(lang): declare primary language for page" [130b]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/b3f998eb78fbb3632747dc7df4fcb5d58adfeeab "style(.article-more-link): padding in mobile" ### 03-19 页面进度条 > - [[G]][129] [[G]][129a] 合并 Pull, 引入 [pace.js][129b], 以便在页面加载时显示进度条。网站访问不够快时,用进度条调剂下也是不错的; > - [[G]][129c] 微调目录按钮位置,顺便提取变量,方便调整目录高度。 [129]: https://github.com/MOxFIVE/hexo-theme-yelee/pull/59 "增加进度条显示" [129a]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/cc59bd2b7263acd14a0f40019bac1b6bd5b54ed0 "doc: Progress Bar | 页面加载进度条" [129b]: https://github.com/HubSpot/PACE "Automatically add a progress bar to your site" [129c]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/fc27567698d3cc3cebec5f2f8d956ec4712f9080 "style: position of TOC Button" ### 03-16 代码优化 > - [[G]][128] 把部分与主题配置关联不大的 JavaScript 代码移到单独的 JS 文件中,以减小静态文件体积和提升页面加载速度。原本想把每一个功能做成一个组件,只是用 EJS 模板似乎不够理想,暂时这样吧。 > - [[G]][128a] 调整样式,避免友情链接中的标题被换行。 [128]: https://github.com/MOxFIVE/hexo-theme-yelee/commit/0d5a87c485270a6b9698a3181df56564c970c6ac "style: move