blog

My blog at www.shimmy1996.com

git clone git://git.shimmy1996.com/blog.git
commit 06f8710d1e53c9431ca0e8ba96409f5f89cd07d8
parent 6c11fb0047df3211b35bbbf18a22df32a3262144
Author: Shimmy Xu <shimmy.america@gmail.com>
Date:   Mon,  4 Sep 2017 12:31:01 -0500

Added language specific links for taxonomy term.html templates and translated tags/categories in i18nConverted all .md to .org because org-mode is awesome.

Diffstat:
M.gitignore | 6++++--
Mconfig.toml | 6+++++-
Dcontent/Contact.md~ | 6------
Dcontent/Messages.en.md~ | 6------
Dcontent/_index.en.md | 34----------------------------------
Acontent/_index.en.org | 34++++++++++++++++++++++++++++++++++
Dcontent/_index.zh.md | 34----------------------------------
Acontent/_index.zh.org | 34++++++++++++++++++++++++++++++++++
Dcontent/about.en.md | 22----------------------
Acontent/about.en.org | 21+++++++++++++++++++++
Dcontent/about.md~ | 6------
Dcontent/about.zh.md | 17-----------------
Dcontent/about.zh.md~ | 8--------
Acontent/about.zh.org | 17+++++++++++++++++
Rcontent/friends.en.md -> content/friends.en.org | 0
Dcontent/friends.md~ | 6------
Rcontent/friends.zh.md -> content/friends.zh.org | 0
Rcontent/messages.en.md -> content/messages.en.org | 0
Rcontent/messages.zh.md -> content/messages.zh.org | 0
Dcontent/posts/2017-08-31-hello-world.en.md~ | 15---------------
Rcontent/posts/2017-08-31-hello-world.en.md -> content/posts/2017-08-31-hello-world.en.org | 0
Dcontent/posts/2017-08-31-hello-world.zh.md~ | 15---------------
Rcontent/posts/2017-08-31-hello-world.zh.md -> content/posts/2017-08-31-hello-world.zh.org | 0
Acontent/posts/2017-09-03-get-emacs-to-work-with-fcitx.en.org | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/posts/2017-09-03-get-emacs-to-work-with-fcitx.zh.org | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Mi18n/en.toml | 8++++++++
Mi18n/zh.toml | 9+++++++++
Mlayouts/_default/terms.html | 4++--
28 files changed, 234 insertions(+), 174 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,2 +1,4 @@
 public
-themes/*-
\ No newline at end of file
+themes/*
+content/*~
+content/*/*~+
\ No newline at end of file
diff --git a/config.toml b/config.toml
@@ -11,13 +11,17 @@ DefaultContentLanguage  = "en"
 DefaultContentLanguageInSubdir = true
 
 [permalinks]
-post = "/post/:year/:month/:day/:slug/"
+posts = "/posts/:year/:month/:day/:slug/"
 
 [author]
 name                    = "Shimmy Xu"
 github                  = "shimmy1996"
 twitter                 = "shimmy1996"
 
+[Taxonomies]
+tag = "tags"
+categories = "categories"
+
 [Languages]
 [Languages.en]
 title                   = "Library of Trantor"
diff --git a/content/Contact.md~ b/content/Contact.md~
@@ -1,6 +0,0 @@
----
-title: "Contact"
-date: 2017-08-26T10:02:50-07:00
-draft: true
----
-
diff --git a/content/Messages.en.md~ b/content/Messages.en.md~
@@ -1,6 +0,0 @@
----
-title: "Messages"
-date: 2017-08-27T19:40:16-07:00
-draft: true
----
-
diff --git a/content/_index.en.md b/content/_index.en.md
@@ -1,34 +0,0 @@
----
-title: Home
-curl: "home"
----
-
-# Trantor Library
-_The Plan needs to go on._
-
-<span style="color:red">Fair Warning: Site under heavy construction.</span>
-
-## Site Roadmap
-
-- [x] ~~Find new hosting location.~~ Currently using digitalocean.
-- [x] Install Arch Linux on server.
-- [x] ~~Search for WP replacement.~~ Hugo is pretty good.
-- [x] ~~Find a suitable theme.~~ Currently using `hugo-xmin`, may consider forking it and write my own ( `soresu` ).
-- [x] Server side config, like `post-receive` for git auto deploy.
-- [x] Language switcher that does more than redirecting to home page.
-- [x] Enable Disqus.
-- [x] Support `$\LaTeX$` expressions via MathJax.
-- [x] Copy-paste fixed page contents from old site (and translate them).
-- [x] Enable https.
-- [x] Backup old WP site.
-- [x] Transfer domain and ensure NDS works as intended.
-- [ ] Configure multilingual support, including footer text, title, etc.
-- [ ] Use Google Noto Font.
-- [ ] Customizable Disqus via Disqus API.
-- [ ] Find out how to write with `org-mode` or R markdown.
-- [ ] Find out how to make `emacs` work with `fcitx`.
-- [ ] Customize `hugo new` to make it more useful, i.e. create multilingual versions directly.
-- [ ] Restore/rewrite and translate some of the more valuable old posts.
-- [ ] Find a suitable icon/favicon.
-
-## Recent Posts
diff --git a/content/_index.en.org b/content/_index.en.org
@@ -0,0 +1,34 @@
+---
+title: Home
+curl: "home"
+---
+
+* Trantor Library
+/The Plan needs to go on./
+
+<span style="color:red">Fair Warning: Site under heavy construction.</span>
+
+** Site Roadmap
+
+- [x] +Find new hosting location.+ Currently using digitalocean.
+- [x] Install Arch Linux on server.
+- [x] +Search for WP replacement.+ Hugo is pretty good.
+- [x] +Find a suitable theme.+ Currently using ~hugo-xmin~, may consider forking it and write my own ( ~soresu~ ).
+- [x] Server side config, like ~post-receive~ for git auto deploy.
+- [x] Language switcher that does more than redirecting to home page.
+- [x] Enable Disqus.
+- [x] Support ~$\LaTeX$~ expressions via MathJax.
+- [x] Copy-paste fixed page contents from old site (and translate them).
+- [x] Enable https.
+- [x] Backup old WP site.
+- [x] Transfer domain and ensure NDS works as intended.
+- [x] Find out how to write with ~org-mode~ or R markdown.
+- [x] Customizable Disqus via Disqus API.
+- [x] Configure multilingual support, including footer text, title, etc.
+- [ ] Use Google Noto Font.
+- [ ] Find out how to make ~emacs~ work with ~fcitx~.
+- [ ] Customize ~hugo new~ to make it more useful, i.e. create multilingual versions directly.
+- [ ] Restore/rewrite and translate some of the more valuable old posts.
+- [ ] Find a suitable icon/favicon.
+
+** Recent Posts
diff --git a/content/_index.zh.md b/content/_index.zh.md
@@ -1,34 +0,0 @@
----
-title: Home
-curl: "home"
----
-
-# 川坨大学图书室
-_计划进行中_
-
-<span style="color:red">注意:本站仍处于施工中。</span>
-
-## 施工计划
-
-- [x] ~~找一家新的服务器提供商~~ 目前使用Digitalocean。
-- [x] 在服务器上安装Arch Linux。
-- [x] ~~搜寻WP的替代品。~~ Hugo很不错。
-- [x] ~~找一个合适的主题。~~ 目前使用 `hugo-xmin`,考虑fork出来写成自己的主题( `soresu` )。
-- [x] 完成服务器端设置,比如添加 `post-receive` 来实现 `git` 自动部署。
-- [x] 可以切换__当前页面__语言版本的语言切换按钮。
-- [x] Disqus支持。
-- [x] 用MathJax实现 `$\LaTeX$` 表达式支持。
-- [x] 把导航页的内容搬过来并翻译。
-- [x] https支持。
-- [x] 备份原WP站点。
-- [x] 转移域名到Google Domain,并完成NDS设置。
-- [ ] 设置多语言支持,添加合适的翻译字符串。
-- [ ] 使用Google Noto Font。
-- [ ] 用Disqus API实现可以自定义的评论框。
-- [ ] 尝试使用 `org-mode` 或者 R markdown 来写博客。
-- [ ] 解决 `emacs` 不兼容 `fcitx` 的问题。
-- [ ] 尝试把 `hugo new` 变得更有用一些,比如直接创建多语言版本等。
-- [ ] 把比较有价值的旧文章搬过来。
-- [ ] 为站点和社交网站找一个合适的图标/头像。
-
-## 最新日志
diff --git a/content/_index.zh.org b/content/_index.zh.org
@@ -0,0 +1,34 @@
+---
+title: Home
+curl: "home"
+---
+
+* 川坨大学图书室
+/计划进行中/
+
+<span style="color:red">注意:本站仍处于施工中。</span>
+
+** 施工计划
+
+- [x] +找一家新的服务器提供商+ 目前使用Digitalocean。
+- [x] 在服务器上安装Arch Linux。
+- [x] +搜寻WP的替代品。+ Hugo很不错。
+- [x] +找一个合适的主题。+ 目前使用 ~hugo-xmin~ ,考虑fork出来写成自己的主题( ~soresu~ )。
+- [x] 完成服务器端设置,比如添加 ~post-receive~ 来实现 ~git~ 自动部署。
+- [x] 可以切换__当前页面__语言版本的语言切换按钮。
+- [x] Disqus支持。
+- [x] 用MathJax实现 ~$\LaTeX$~ 表达式支持。
+- [x] 把导航页的内容搬过来并翻译。
+- [x] https支持。
+- [x] 备份原WP站点。
+- [x] 转移域名到Google Domain,并完成NDS设置。
+- [x] 尝试使用 ~org-mode~ 或者 R markdown 来写博客。
+- [x] 解决 ~emacs~ 不兼容 ~fcitx~ 的问题。
+- [x] 设置多语言支持,添加合适的翻译字符串。
+- [ ] 使用Google Noto Font。
+- [ ] 用Disqus API实现可以自定义的评论框。
+- [ ] 尝试把 ~hugo new~ 变得更有用一些,比如直接创建多语言版本等。
+- [ ] 把比较有价值的旧文章搬过来。
+- [ ] 为站点和社交网站找一个合适的图标/头像。
+
+** 最新日志
diff --git a/content/about.en.md b/content/about.en.md
@@ -1,21 +0,0 @@
----
-title: "About"
-slug: "about"
-draft: false
----
-
-## About me:
-
-Actively searching for the ultimate answer to the universe. 
-
-No longer a fan of the slow and clunky Wordpress, I switched to Hugo.
-
-Most of my social network accounts use the name ```shimmy1996```.
-
-## About this site:
-
-Up and running since July 12th, 2014. 
-
-<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license"><img style="border-width: 0;" src="https://i2.wp.com/i.creativecommons.org/l/by-nc-sa/4.0/88x31.png?w=960&#038;ssl=1" alt="Creative Commons License" data-recalc-dims="1" /></a>
-
-This site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.-
\ No newline at end of file
diff --git a/content/about.en.org b/content/about.en.org
@@ -0,0 +1,21 @@
+---
+title: "About"
+slug: "about"
+draft: false
+---
+
+** About me:
+
+Actively searching for the ultimate answer to the universe. 
+
+No longer a fan of the slow and clunky Wordpress, I switched to Hugo.
+
+Most of my social network accounts use the name ```shimmy1996```.
+
+** About this site:
+
+Up and running since July 12th, 2014. 
+
+<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license"><img style="border-width: 0;" src="https://i2.wp.com/i.creativecommons.org/l/by-nc-sa/4.0/88x31.png?w=960&#038;ssl=1" alt="Creative Commons License" data-recalc-dims="1" /></a>
+
+This site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
diff --git a/content/about.md~ b/content/about.md~
@@ -1,6 +0,0 @@
----
-title: "About"
-date: 2017-08-25T21:55:58-05:00
-draft: true
----
-
diff --git a/content/about.zh.md b/content/about.zh.md
@@ -1,16 +0,0 @@
----
-title: "关于"
-slug: "about"
-draft: false
----
-
-## 关于博主:
-
-EE狗,目前在德州放牛;技术渣,~~WP~~Hugo新手;ACG相关;喜欢硬件但是没有小钱钱;足迹可能遍布各大社交网站,通常名字为shimmy1996;求友链XDD。
-
-## 关于本站:
-建于2014年7月12日,用来放各种奇怪的东西。
-
-<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license"><img style="border-width: 0;" src="https://i2.wp.com/i.creativecommons.org/l/by-nc-sa/4.0/88x31.png?w=960&#038;ssl=1" alt="Creative Commons License" data-recalc-dims="1" /></a>
-
-This site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.-
\ No newline at end of file
diff --git a/content/about.zh.md~ b/content/about.zh.md~
@@ -1,7 +0,0 @@
----
-title: "About"
-date: 2017-08-25T21:55:58-05:00
-draft: false
----
-
-Hello World-
\ No newline at end of file
diff --git a/content/about.zh.org b/content/about.zh.org
@@ -0,0 +1,16 @@
+---
+title: "关于"
+slug: "about"
+draft: false
+---
+
+** 关于博主:
+
+EE狗,目前在德州放牛;技术渣,~~WP~~Hugo新手;ACG相关;喜欢硬件但是没有小钱钱;足迹可能遍布各大社交网站,通常名字为shimmy1996;求友链XDD。
+
+** 关于本站:
+建于2014年7月12日,用来放各种奇怪的东西。
+
+<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license"><img style="border-width: 0;" src="https://i2.wp.com/i.creativecommons.org/l/by-nc-sa/4.0/88x31.png?w=960&#038;ssl=1" alt="Creative Commons License" data-recalc-dims="1" /></a>
+
+This site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.+
\ No newline at end of file
diff --git a/content/friends.en.md b/content/friends.en.org
diff --git a/content/friends.md~ b/content/friends.md~
@@ -1,6 +0,0 @@
----
-title: "Friends"
-date: 2017-08-27T20:11:20-07:00
-draft: true
----
-
diff --git a/content/friends.zh.md b/content/friends.zh.org
diff --git a/content/messages.en.md b/content/messages.en.org
diff --git a/content/messages.zh.md b/content/messages.zh.org
diff --git a/content/posts/2017-08-31-hello-world.en.md~ b/content/posts/2017-08-31-hello-world.en.md~
@@ -1,15 +0,0 @@
-+++
-title           = "Hello World!"
-description     = "Same old first post."
-date            = 2017-08-31T23:09:59-05:00
-draft           = false
-tags            = ["Hugo"
-                  ]
-categories      = ["Site Related"
-                  ]
-slug            =  "hello world"
-isCJKLanguage   = false
-+++
-
-Hello world!
-
diff --git a/content/posts/2017-08-31-hello-world.en.md b/content/posts/2017-08-31-hello-world.en.org
diff --git a/content/posts/2017-08-31-hello-world.zh.md~ b/content/posts/2017-08-31-hello-world.zh.md~
@@ -1,15 +0,0 @@
-+++
-title           = "Hello World!"
-description     = "Same old first post."
-date            = 2017-08-31T23:09:59-05:00
-draft           = false
-tags            = ["Hugo"
-                  ]
-categories      = ["Site Related"
-                  ]
-slug            =  "hello world"
-isCJKLanguage   = false
-+++
-
-Hello world!
-
diff --git a/content/posts/2017-08-31-hello-world.zh.md b/content/posts/2017-08-31-hello-world.zh.org
diff --git a/content/posts/2017-09-03-get-emacs-to-work-with-fcitx.en.org b/content/posts/2017-09-03-get-emacs-to-work-with-fcitx.en.org
@@ -0,0 +1,50 @@
++++
+title           = "Get Emacs to Work With Fcitx"
+description     = ""
+date            = 2017-09-03T23:20:27-05:00
+draft           = true
+tags            = [
+                  ]
+categories      = [
+                  ]
+slug            = "get-emacs-to-work-with-fcitx"
+isCJKLanguage   = false
++++
+
+* Enabling fcitx in emacs
+
+** fcitx-diagnose
+
+** locale settings
+export zh_cn.utf-8
+set lc_ctype=zh_cn.utf-8
+
+** fcitx plugin in emacs
+
+** disabling ctrl+space hot key
+replaced with os+space and ctrl+os
+
+* could be better
+
+do not want set lc-ctype globally
+run emacs as daemon
+
+** create new entry in .config/systemd/user/emacs.service
+
+** add environment variable
+
+** problem: does not load init file
+
+
+** setting up alias of emacsclient -nc in .zshrc
+alias e="emacsclient -nc"
+
+
+
+
+
+
+
+
+
+
diff --git a/content/posts/2017-09-03-get-emacs-to-work-with-fcitx.zh.org b/content/posts/2017-09-03-get-emacs-to-work-with-fcitx.zh.org
@@ -0,0 +1,50 @@
++++
+title           = "在emacs里使用fcitx"
+description     = ""
+date            = 2017-09-03T23:20:27-05:00
+draft           = true
+tags            = [
+                  ]
+categories      = [
+                  ]
+slug            =  "get-emacs-to-work-with-fcitx"
+isCJKLanguage   = true
++++
+
+* Enabling fcitx in emacs
+
+** fcitx-diagnose
+
+** locale settings
+export zh_cn.utf-8
+set lc_ctype=zh_cn.utf-8
+
+** fcitx plugin in emacs
+
+** disabling ctrl+space hot key
+replaced with os+space and ctrl+os
+
+* could be better
+
+do not want set lc-ctype globally
+run emacs as daemon
+
+** create new entry in .config/systemd/user/emacs.service
+
+** add environment variable
+
+** problem: does not load init file
+
+
+** setting up alias of emacsclient -nc in .zshrc
+alias e="emacsclient -nc"
+
+
+
+
+
+
+
+
+
+
diff --git a/i18n/en.toml b/i18n/en.toml
@@ -9,3 +9,11 @@ other = "Tags"
 
 [Categories]
 other = "Categories"
+
+# Translation for tags
+[Hugo]
+other = "Hugo"
+
+# Translation for categories
+[Site\ Related]
+other = "Site Related"
diff --git a/i18n/zh.toml b/i18n/zh.toml
@@ -9,3 +9,11 @@ other = "标签"
 
 [Categories]
 other = "分类"
+
+# Translation for tags
+[Hugo]
+other = "Hugo"
+
+# Translation for categories
+[Site\ Related]
+other = "站点相关"+
\ No newline at end of file
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
@@ -5,8 +5,8 @@
 <ul class="terms">
   {{ range $key, $value := .Data.Terms }}
   <li>
-    <a href="{{ (print "/" $.Data.Plural "/" $key | urlize) | relURL }}">
-      {{ $key }}
+    <a href="{{ (print "/" $.Site.Language.Lang "/" $.Data.Plural "/" $key | urlize) | relURL }}">
+      {{ i18n $key }}
     </a>
     ({{ len $value }})
   </li>