diff options
Diffstat (limited to '_sources')
-rw-r--r-- | _sources/_posts/2018/01/new-blog.rst.txt | 72 | ||||
-rw-r--r-- | _sources/index.rst.txt | 167 |
2 files changed, 0 insertions, 239 deletions
diff --git a/_sources/_posts/2018/01/new-blog.rst.txt b/_sources/_posts/2018/01/new-blog.rst.txt deleted file mode 100644 index a638797..0000000 --- a/_sources/_posts/2018/01/new-blog.rst.txt +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | :orphan: | ||
2 | |||
3 | .. _2018newblog: | ||
4 | |||
5 | 又一个新的博客 | ||
6 | ============== | ||
7 | |||
8 | :Publish Date: 2018-01-15 | ||
9 | |||
10 | 前段时间有朋友和我抱怨博客加载速度太慢了(。之前的博客架在Blogger上,为了让排版稍微美观一些,找了一个第三方的主题,加载了许多外部的 | ||
11 | 资源,导致网页载入速度非常慢。虽然我自己对于网站在国内的加载速度毫不在意,但是既然还有读者(少的可怜)在看,以及在这极少的读者中有用 | ||
12 | 户提出了这个问题,那就得解决。前段时间无意中看到一个博客( `git-pull`_ ),觉得主题简洁而又美观,于是开始 | ||
13 | 着手改造自己的博客。 | ||
14 | |||
15 | .. _git-pull: https://www.git-pull.com/index.html | ||
16 | |||
17 | 这次用了「大名鼎鼎」的 `Sphinx`_ ,一个软件开发过程中的文档生成工具来作为博客的静态网页生成引擎。 | ||
18 | 上手Sphinx非常简单,sphinx-quickstart这个工具和一般的博客生成器一样,集成了很多功能,把Makefile都写好了,可以说是完全开箱即用了。 | ||
19 | Sphinx的默认主题是 `Alabaster`_ ,现在你看到的这个主题就是在Alabaster上修改而来的。 | ||
20 | |||
21 | Sphinx的文档书写采用的是*.rst格式的文本,即 `reStructuredText`_ ,而不是Markdown。相比 | ||
22 | 之前,rst比Markdown的语法更加丰富/复杂,同时也提供了更加丰富的功能和可扩展性(虽然我估计我只能用到其中的20%甚至更少啦)。不清楚rst和 | ||
23 | Emacs社区的 `Org Mode`_ 相比哪一个的语法更加复杂呢。( | ||
24 | |||
25 | 建设博客离不开几件事情。首先当然就是部署运维啦。Sphinx通过Makefile可以生成静态html网页,托管静态html最方便的地方当然是GitHub Pages啦。 | ||
26 | 最简单粗暴的方法是在本地的环境中写完rst文本,然后本地 make html 通过之后,将html推送到GitHub Pages中。但是这种方式的移植性不高,想写 | ||
27 | 博客的话必须坐在自己的电脑前,同时依然存在一些手动的工作。所以当然选择Docker啦。但是这次用Docker的姿势和以往不同。平时我们用Docker的时候 | ||
28 | 最终都是想要得到docker build的产物docker image,然后由image来进行部署。但是我们这次的目标是GitHub Pages,没法部署容器。所以我在 | ||
29 | Dockerfile中生成静态html网页,然后在构建的过程中将静态网页push到repo的gh-pages分支中。当然其实不用Docker也能做到这一点。写一个脚本, | ||
30 | 然后在CI平台上执行脚本也行,就不做优劣对比了。 | ||
31 | |||
32 | 值得一提的是,Docker在17.05-ce版本之后引入了multi stage build的功能,可以在Dockerfile中FROM多个基础镜像,在下一个stage可以直接使用 | ||
33 | 之前stage构建出的产物。以我的博客这个项目为例。假如我是想通过image来部署,那么我最终的产物是静态html文件,那么我可能需要一个nginx的基础 | ||
34 | 镜像。nginx:alpine 这个基础镜像很小,不到10MB,在Dockerfile里面将html文件COPY进去之后,最终得到的image也只有10MB左右的大小。但是 | ||
35 | 之前我们为了得到静态html文件,可能得选用一个python的基础镜像,然后再apt/apk安装一些必要的编译工具,最终只是为了几百kb的html文件,但是 | ||
36 | 构建的镜像已经上百MB了。有了multi stage build之后,这个问题便非常好地被解决了。看了下面的Dockerfile之后,整体思路就非常清晰了。目前我 | ||
37 | 在本地写完rst文本,然后git push之后,CircleCI会自动进行Dockerfile的构建,然后将编译生成的静态html推送到gh-pages分支。 | ||
38 | |||
39 | .. raw:: html | ||
40 | |||
41 | <embed> | ||
42 | <script src="https://gist.github.com/clarkzjw/0cb4e15794a5a132b12df9741e0cc1e0.js"></script> | ||
43 | </embed> | ||
44 | |||
45 | 另外一个问题是博客的RSS。由于Sphinx最初的设计是作为一个文档生成工具,目前市面上有的和Sphinx结合的RSS生成工具大致有: | ||
46 | |||
47 | - Sphinx-contrib模块中的 `feed <https://bitbucket.org/birkenfeld/sphinx-contrib/src/tip/feed/>`__ | ||
48 | |||
49 | - 在sphinxcontrib.feed基础上开发的 `sphinxfeed <https://github.com/junkafarian/sphinxfeed>`__ | ||
50 | |||
51 | - 以及更新一点的 `sphinxcontrib-newsfeed <https://pypi.python.org/pypi/sphinxcontrib-newsfeed>`__ | ||
52 | |||
53 | 其中sphinxcontrib.feed和sphinxfeed的功能性更新都停止在2011年,不兼容Python 3,GitHub上有几个fork,但是也基本没有太多的改进。至于 | ||
54 | sphinxcontrib-newsfeed,并不能生成符合RSS规范的输出。。。所以只好自己简单粗暴造一个轮子了!(至少生成的xml能被RSS阅读器认识。。。 | ||
55 | |||
56 | RSS 订阅地址是 https://blog.jinwei.me/rss | ||
57 | |||
58 | 至于评论嘛。虽然博客流量小,2017年下来一年也没有10条评论,但是作为一个博客,这个功能还是必须得有!考察了目前市面上的评论方案,Disqus现在 | ||
59 | 差不多可以算是一家独大了。但是十分不喜欢Disqus。一个页面要加载的无关的数据太多了。然后看到了 `Isso`_ , 第一印象还不错,但是需要自己单独部 | ||
60 | 署。为了一年10条评论不到的数量级单独部署似乎成本略高。之前还见到了 `Staticman`_ , 但是这个方案和GitHub的issue绑定,一个博客实例对应 | ||
61 | GitHub的一个repo,然后每篇文章的评论对应这个repo中的issue。但是我不太能接受,毕竟不能强制每个评论的用户都有GitHub帐号。 | ||
62 | 今天无意中看到了 `just-comments`_ , 也是一个SaaS解决方案,但是非常地极简,决定先用着试试效果。( | ||
63 | |||
64 | 下一步,打算在博客中加入 `漢字標準格式 <https://css.hanzi.co/>`_ 这套排版框架。毕竟现在的页面排版看起来怪怪的,以及并不美观。( | ||
65 | |||
66 | .. _Org Mode: https://orgmode.org/ | ||
67 | .. _reStructuredText: http://docutils.sourceforge.net/rst.html | ||
68 | .. _Alabaster: https://alabaster.readthedocs.io/en/latest/ | ||
69 | .. _Sphinx: http://www.sphinx-doc.org/en/stable/ | ||
70 | .. _Isso: https://github.com/posativ/isso | ||
71 | .. _Staticman: https://staticman.net | ||
72 | .. _just-comments: https://just-comments.com/ | ||
diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt deleted file mode 100644 index 21b52f8..0000000 --- a/_sources/index.rst.txt +++ /dev/null | |||
@@ -1,167 +0,0 @@ | |||
1 | .. blog.jinwei.me | ||
2 | |||
3 | Hello World | ||
4 | =========== | ||
5 | |||
6 | .. toctree:: | ||
7 | :maxdepth: 2 | ||
8 | :caption: Contents: | ||
9 | |||
10 | Updates | ||
11 | ------- | ||
12 | |||
13 | - **June 2020** | ||
14 | |||
15 | - `天文现象邮票 <https://stamp.jinwei.me/2020/06/21/eclipse/>`__ | ||
16 | - `中華民國歷任總統就職紀念郵票 <https://stamp.jinwei.me/2020/06/18/roc-presidents-inauguration/>`__ | ||
17 | - `COVID-19防疫纪念邮票对比 <https://stamp.jinwei.me/2020/06/15/covid-19-stamp/>`__ | ||
18 | |||
19 | - **Jan 2020** | ||
20 | |||
21 | - `2019年度总结 <https://medium.com/@clarkzjw/2019%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93-55eb4f242b26>`__ | ||
22 | |||
23 | - **June 2019** | ||
24 | |||
25 | - `2019半年度总结 <https://medium.com/@clarkzjw/2019%E5%8D%8A%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93-ac59b681224>`__ | ||
26 | - `在2019年安装Docker是怎样一种体验 <https://medium.com/@clarkzjw/%E5%9C%A82019%E5%B9%B4%E5%AE%89%E8%A3%85docker%E6%98%AF%E6%80%8E%E6%A0%B7%E4%B8%80%E7%A7%8D%E4%BD%93%E9%AA%8C-4068e6210365>`__ | ||
27 | |||
28 | - **October 2018** | ||
29 | |||
30 | - `不再尴尬的ChromeOS <https://medium.com/@clarkzjw/%E4%B8%8D%E5%86%8D%E5%B0%B4%E5%B0%AC%E7%9A%84chromeos-e81f4c6c42a1>`__ | ||
31 | - `我与Ingress的1545天 <https://medium.com/@clarkzjw/%E6%88%91%E4%B8%8Eingress%E7%9A%841545%E5%A4%A9-a13a7883f7c2>`__ | ||
32 | |||
33 | - **August 2018** | ||
34 | |||
35 | - `【系列】爱沙尼亚电子公民不完全指南 <https://medium.com/%E7%88%B1%E6%B2%99%E5%B0%BC%E4%BA%9A%E7%94%B5%E5%AD%90%E5%85%AC%E6%B0%91%E4%B8%8D%E5%AE%8C%E5%85%A8%E6%8C%87%E5%8D%97>`__ | ||
36 | |||
37 | - **December 2017** | ||
38 | |||
39 | - `2017 观影记录 <https://medium.com/@clarkzjw/2017%E8%A7%82%E5%BD%B1%E8%AE%B0%E5%BD%95-438e53f1aaee>`__ | ||
40 | - `The One Device: Experience of Pixel 2 <https://medium.com/@clarkzjw/the-one-device-experience-of-pixel-2-72593cb2771b>`__ | ||
41 | |||
42 | - **October 2017** | ||
43 | |||
44 | - `注销/删除一个互联网帐号有多难 <https://medium.com/@clarkzjw/%E6%B3%A8%E9%94%80-%E5%88%A0%E9%99%A4%E4%B8%80%E4%B8%AA%E4%BA%92%E8%81%94%E7%BD%91%E5%B8%90%E5%8F%B7%E6%9C%89%E5%A4%9A%E9%9A%BE-7c093ea0873e>`__ | ||
45 | |||
46 | - **July 2017** | ||
47 | |||
48 | - `我的大学 <https://medium.com/@clarkzjw/%E6%88%91%E7%9A%84%E5%A4%A7%E5%AD%A6-d6e4282c886a>`__ | ||
49 | |||
50 | - **March 2017** | ||
51 | |||
52 | - `Macbook Pro Late 2016一周体验 <https://medium.com/@clarkzjw/macbook-pro-late-2016%E4%B8%80%E5%91%A8%E4%BD%93%E9%AA%8C-667474f7925d>`__ | ||
53 | |||
54 | - **October 2016** | ||
55 | |||
56 | - `Yubikey 4 入手 <https://medium.com/@clarkzjw/yubikey-4%E5%85%A5%E6%89%8B-51ec9f8c92eb>`__ | ||
57 | - `ERROR 451: 本網頁基於國家法律而封鎖 <https://medium.com/@clarkzjw/error-451-%E6%9C%AC%E7%B6%B2%E9%A0%81%E5%9F%BA%E6%96%BC%E5%9C%8B%E5%AE%B6%E6%B3%95%E5%BE%8B%E8%80%8C%E5%B0%81%E9%8E%96-1ad999b31847>`__ | ||
58 | |||
59 | - **September 2016** | ||
60 | |||
61 | - `Moto X 2014 XT1085刷CM指南 <https://medium.com/@clarkzjw/moto-x-2014-xt1085%E5%88%B7cm%E6%8C%87%E5%8D%97-db8886256ba7>`__ | ||
62 | |||
63 | - **August 2016** | ||
64 | |||
65 | - `[这列火车] 从北京到莫斯科 <https://medium.com/@clarkzjw/%E8%BF%99%E5%88%97%E7%81%AB%E8%BD%A6-%E4%BB%8E%E5%8C%97%E4%BA%AC%E5%88%B0%E8%8E%AB%E6%96%AF%E7%A7%91-cbcc17b66c03>`__ | ||
66 | |||
67 | - **April 2016** | ||
68 | |||
69 | - `安利好用的邮件服务之Fastmail <https://medium.com/@clarkzjw/%E5%AE%89%E5%88%A9%E5%A5%BD%E7%94%A8%E7%9A%84%E9%82%AE%E4%BB%B6%E6%9C%8D%E5%8A%A1%E4%B9%8Bfastmail-3f335bebdaaf>`__ | ||
70 | |||
71 | About me | ||
72 | -------- | ||
73 | |||
74 | - Software engineer | ||
75 | - Amateur HAMer(BG5DHM) | ||
76 | - Estonian e-Resident | ||
77 | - Programming with Python, Golang, C, etc | ||
78 | - A user of Vim, Debian, OpenStack, Docker, Raspberry Pi, etc | ||
79 | - Ingress resistance | ||
80 | |||
81 | Language Skills | ||
82 | --------------- | ||
83 | |||
84 | - Mandarin - Native or Bilingual proficiency | ||
85 | - English - Professional working proficiency | ||
86 | |||
87 | Publications | ||
88 | ------------ | ||
89 | |||
90 | - `Texture filtering based physically plausible image dehazing <https://link.springer.com/article/10.1007%2Fs00371-016-1259-3>`__ | ||
91 | - `暗通道先验图像去雾的大气光校验和光晕消除 <http://www.cjig.cn/jig/ch/reader/view_abstract.aspx?file_no=20160911&flag=1>`__ | ||
92 | |||
93 | Contact | ||
94 | ------- | ||
95 | |||
96 | - Feel free to contact me! | ||
97 | - PGP: `0x1D017D3D <https://keybase.io/clarkzjw/pgp_keys.asc?fingerprint=b878c370cf7d871faa3c76637e1eb1851d017d3d>`_ | `keybase.io <https://keybase.io/clarkzjw>`_ | ||
98 | - Telegram: `@clarkzjw <https://t.me/clarkzjw>`_ | ||
99 | - Twitter: `_clarkzjw <https://twitter.com/_clarkzjw>`_ | ||
100 | - Mail to: `[email protected] <mailto:[email protected]>`_ | ||
101 | |||
102 | Links | ||
103 | ----- | ||
104 | |||
105 | - `Uucky's Wonderland <https://uuc.ky/>`__ | ||
106 | - `USDWeekly <https://usdweekly.com/>`__ | ||
107 | - `Stray Episode <https://farer.org/>`__ | ||
108 | - `Sakeven <https://sakeven.me/>`__ | ||
109 | - `Justjjy <https://justjjy.com/>`__ | ||
110 | - `realityone <https://reality0ne.com/>`__ | ||
111 | |||
112 | |||
113 | Other | ||
114 | ----- | ||
115 | |||
116 | - I was a volunteer of BOINC, supporting experiment like `World Community Grid`_ and `SETI@home`_ | ||
117 | |||
118 | - I think Freedom is my birth right and I shall have it, including free speech and free software | ||
119 | |||
120 | .. raw:: html | ||
121 | |||
122 | <iframe src="https://www.worldcommunitygrid.org/getDynamicImage.do?memberName=clarkzjw&mnOn=true&stat=3&imageNum=1&rankOn=true&projectsOn=true&special=true" frameborder="0" name="di" scrolling="no" width="405px" height="190px"></iframe> | ||
123 | |||
124 | .. container:: row | ||
125 | |||
126 | .. container:: project | ||
127 | |||
128 | .. figure:: https://boincstats.com/signature/-1/user/3483994/sig.png | ||
129 | :align: left | ||
130 | :target: https://boincstats.com/en/stats/-1/user/detail/59d322a65a0667a4207b6dc6ed9780ee | ||
131 | :alt: bonic stats | ||
132 | :height: 100 | ||
133 | |||
134 | |||
135 | .. container:: row | ||
136 | |||
137 | .. container:: project | ||
138 | |||
139 | .. figure:: https://cdn.clarkzjw.cn/redtestbar.gif | ||
140 | :align: left | ||
141 | :target: https://tomli.blog/archives/2016/06/2124.html | ||
142 | :alt: tomli.blog | ||
143 | :height: 150 | ||
144 | |||
145 | .. container:: row | ||
146 | |||
147 | .. container:: project | ||
148 | |||
149 | .. figure:: https://cdn.clarkzjw.cn/Sample_09-F9_protest_art,_Free_Speech_Flag_by_John_Marcotte.png | ||
150 | :align: left | ||
151 | :target: https://en.wikipedia.org/wiki/Free_Speech_Flag | ||
152 | :alt: en.wikipedia.org | ||
153 | :height: 150 | ||
154 | |||
155 | - Dream travel: | ||
156 | |||
157 | - Taking `Beijing – Moscow Train K3 <https://zh.wikipedia.org/wiki/K3/4%E6%AC%A1%E5%88%97%E8%BD%A6>`_ | ||
158 | - Visiting `Korean DMZ <https://en.wikipedia.org/wiki/Korean_Demilitarized_Zone>`_ from both sides. | ||
159 | |||
160 | Credit | ||
161 | ------ | ||
162 | |||
163 | - All original contents of this site are licensed under `CC BY-SA 3.0 CN <https://creativecommons.org/licenses/by-sa/3.0/cn/>`_ | ||
164 | |||
165 | |||
166 | .. _World Community Grid: https://www.worldcommunitygrid.org/ | ||
167 | .. _SETI@home: https://setiathome.berkeley.edu/ | ||