diff options
author | clarkzjw <[email protected]> | 2020-06-16 08:36:31 +0000 |
---|---|---|
committer | clarkzjw <[email protected]> | 2020-06-16 08:36:31 +0000 |
commit | d886abacbc797d5b1a45d0042750329fa577c6ae (patch) | |
tree | 407df684bf8ff2c1a11ef983d02be93fd77ae0b5 /_sources | |
parent | 3a5a51d9028b48d6762e6bedf8c124593fc5f99b (diff) | |
download | blog.jinwei.me-d886abacbc797d5b1a45d0042750329fa577c6ae.tar.gz |
Tue Jun 16 08:36:31 UTC 2020
Diffstat (limited to '_sources')
-rw-r--r-- | _sources/_posts/2018/01/new-blog.rst.txt | 72 | ||||
-rw-r--r-- | _sources/index.rst.txt | 176 |
2 files changed, 248 insertions, 0 deletions
diff --git a/_sources/_posts/2018/01/new-blog.rst.txt b/_sources/_posts/2018/01/new-blog.rst.txt new file mode 100644 index 0000000..a638797 --- /dev/null +++ b/_sources/_posts/2018/01/new-blog.rst.txt | |||
@@ -0,0 +1,72 @@ | |||
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 new file mode 100644 index 0000000..1957b53 --- /dev/null +++ b/_sources/index.rst.txt | |||
@@ -0,0 +1,176 @@ | |||
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 | - `COVID-19防疫纪念邮票对比 <https://stamp.jinwei.me/2020/06/15/covid-19-stamp/>`__ | ||
16 | |||
17 | - **Jan 2020** | ||
18 | |||
19 | - `2019年度总结 <https://medium.com/@clarkzjw/2019%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93-55eb4f242b26>`__ | ||
20 | |||
21 | - **June 2019** | ||
22 | |||
23 | - `2019半年度总结 <https://medium.com/@clarkzjw/2019%E5%8D%8A%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93-ac59b681224>`__ | ||
24 | - `在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>`__ | ||
25 | |||
26 | - **October 2018** | ||
27 | |||
28 | - `不再尴尬的ChromeOS <https://medium.com/@clarkzjw/%E4%B8%8D%E5%86%8D%E5%B0%B4%E5%B0%AC%E7%9A%84chromeos-e81f4c6c42a1>`__ | ||
29 | - `我与Ingress的1545天 <https://medium.com/@clarkzjw/%E6%88%91%E4%B8%8Eingress%E7%9A%841545%E5%A4%A9-a13a7883f7c2>`__ | ||
30 | |||
31 | - **August 2018** | ||
32 | |||
33 | - `【系列】爱沙尼亚电子公民不完全指南 <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>`__ | ||
34 | |||
35 | - **December 2017** | ||
36 | |||
37 | - `2017 观影记录 <https://medium.com/@clarkzjw/2017%E8%A7%82%E5%BD%B1%E8%AE%B0%E5%BD%95-438e53f1aaee>`__ | ||
38 | - `The One Device: Experience of Pixel 2 <https://medium.com/@clarkzjw/the-one-device-experience-of-pixel-2-72593cb2771b>`__ | ||
39 | |||
40 | - **October 2017** | ||
41 | |||
42 | - `注销/删除一个互联网帐号有多难 <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>`__ | ||
43 | |||
44 | - **July 2017** | ||
45 | |||
46 | - `我的大学 <https://medium.com/@clarkzjw/%E6%88%91%E7%9A%84%E5%A4%A7%E5%AD%A6-d6e4282c886a>`__ | ||
47 | |||
48 | - **March 2017** | ||
49 | |||
50 | - `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>`__ | ||
51 | |||
52 | - **October 2016** | ||
53 | |||
54 | - `Yubikey 4 入手 <https://medium.com/@clarkzjw/yubikey-4%E5%85%A5%E6%89%8B-51ec9f8c92eb>`__ | ||
55 | - `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>`__ | ||
56 | |||
57 | - **September 2016** | ||
58 | |||
59 | - `Moto X 2014 XT1085刷CM指南 <https://medium.com/@clarkzjw/moto-x-2014-xt1085%E5%88%B7cm%E6%8C%87%E5%8D%97-db8886256ba7>`__ | ||
60 | |||
61 | - **August 2016** | ||
62 | |||
63 | - `[这列火车] 从北京到莫斯科 <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>`__ | ||
64 | |||
65 | - **April 2016** | ||
66 | |||
67 | - `安利好用的邮件服务之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>`__ | ||
68 | |||
69 | About me | ||
70 | -------- | ||
71 | |||
72 | - Software engineer | ||
73 | - Amateur HAMer(BG5DHM) | ||
74 | - Estonian e-Resident | ||
75 | - Programming with Python, Golang, C, etc | ||
76 | - A user of Vim, Debian, OpenStack, Docker, Raspberry Pi, etc | ||
77 | - Ingress resistance | ||
78 | |||
79 | Language Skills | ||
80 | --------------- | ||
81 | |||
82 | - Mandarin - Native or Bilingual proficiency | ||
83 | - English - Professional working proficiency | ||
84 | |||
85 | Publications | ||
86 | ------------ | ||
87 | |||
88 | - `Texture filtering based physically plausible image dehazing <https://link.springer.com/article/10.1007%2Fs00371-016-1259-3>`__ | ||
89 | - `暗通道先验图像去雾的大气光校验和光晕消除 <http://www.cjig.cn/jig/ch/reader/view_abstract.aspx?file_no=20160911&flag=1>`__ | ||
90 | |||
91 | Coding around the web | ||
92 | --------------------- | ||
93 | |||
94 | - `Dehaze`_, implementation of dark channel prior based image dehazing algorithms | ||
95 | - `one-two-three...infinity`_, 📏 Calculating the sum from one to a billion in different programming languages, inspired by https://github.com/leachim6/hello-world | ||
96 | - `brainfuck`_, 🙇 Simple Brainfuck interpreter implemented in C | ||
97 | - GitHub `@clarkzjw <https://github.com/clarkzjw>`__ for recent / current coding | ||
98 | |||
99 | .. _Dehaze: https://github.com/clarkzjw/Dehaze | ||
100 | .. _one-two-three...infinity: https://github.com/clarkzjw/one-two-three...infinity | ||
101 | .. _brainfuck: https://github.com/clarkzjw/brainfuck | ||
102 | |||
103 | Contact | ||
104 | ------- | ||
105 | |||
106 | - Feel free to contact me! | ||
107 | - PGP: `0x1D017D3D <https://keybase.io/clarkzjw/pgp_keys.asc?fingerprint=b878c370cf7d871faa3c76637e1eb1851d017d3d>`_ | `keybase.io <https://keybase.io/clarkzjw>`_ | ||
108 | - Telegram: `@clarkzjw <https://t.me/clarkzjw>`_ | Twitter: `_clarkzjw <https://twitter.com/_clarkzjw>`_ | ||
109 | - Mail to: `[email protected] <mailto:[email protected]>`_ | ||
110 | |||
111 | Links | ||
112 | ----- | ||
113 | |||
114 | - `Uucky's Wonderland <https://uuc.ky/>`__ | ||
115 | - `USDWeekly <https://usdweekly.com/>`__ | ||
116 | - `Stray Episode <https://farer.org/>`__ | ||
117 | - `Sakeven <https://sakeven.me/>`__ | ||
118 | - `Justjjy <https://justjjy.com/>`__ | ||
119 | - `realityone <https://reality0ne.com/>`__ | ||
120 | |||
121 | |||
122 | Other | ||
123 | ----- | ||
124 | |||
125 | - I am a volunteer of BOINC, supporting experiment like `World Community Grid`_ and `SETI@home`_ | ||
126 | |||
127 | - I think Freedom is my birth right and I shall have it, including free speech and free software | ||
128 | |||
129 | .. raw:: html | ||
130 | |||
131 | <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> | ||
132 | |||
133 | .. container:: row | ||
134 | |||
135 | .. container:: project | ||
136 | |||
137 | .. figure:: https://boincstats.com/signature/-1/user/3483994/sig.png | ||
138 | :align: left | ||
139 | :target: https://boincstats.com/en/stats/-1/user/detail/59d322a65a0667a4207b6dc6ed9780ee | ||
140 | :alt: bonic stats | ||
141 | :height: 100 | ||
142 | |||
143 | |||
144 | .. container:: row | ||
145 | |||
146 | .. container:: project | ||
147 | |||
148 | .. figure:: https://cdn.clarkzjw.cn/redtestbar.gif | ||
149 | :align: left | ||
150 | :target: https://tomli.blog/archives/2016/06/2124.html | ||
151 | :alt: tomli.blog | ||
152 | :height: 150 | ||
153 | |||
154 | .. container:: row | ||
155 | |||
156 | .. container:: project | ||
157 | |||
158 | .. figure:: https://cdn.clarkzjw.cn/Sample_09-F9_protest_art,_Free_Speech_Flag_by_John_Marcotte.png | ||
159 | :align: left | ||
160 | :target: https://en.wikipedia.org/wiki/Free_Speech_Flag | ||
161 | :alt: en.wikipedia.org | ||
162 | :height: 150 | ||
163 | |||
164 | - Dream travel: | ||
165 | |||
166 | - Taking `Beijing – Moscow Train K3 <https://zh.wikipedia.org/wiki/K3/4%E6%AC%A1%E5%88%97%E8%BD%A6>`_ | ||
167 | - Visiting `Korean DMZ <https://en.wikipedia.org/wiki/Korean_Demilitarized_Zone>`_ from both sides. | ||
168 | |||
169 | Credit | ||
170 | ------ | ||
171 | |||
172 | - All original contents of this site are licensed under `CC BY-SA 3.0 CN <https://creativecommons.org/licenses/by-sa/3.0/cn/>`_ | ||
173 | |||
174 | |||
175 | .. _World Community Grid: https://www.worldcommunitygrid.org/ | ||
176 | .. _SETI@home: https://setiathome.berkeley.edu/ | ||