-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabout.html
98 lines (82 loc) · 2.86 KB
/
about.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
layout: page
title: About Me
description: "Hey, this is Elve Xu"
header-img: "img/about-bg.jpg"
---
<link rel="stylesheet" href="{{ "/timeline/css/style.css" | prepend: site.baseurl }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{ "/timeline/js/bkt6ydm.js" | prepend: site.baseurl }}"/>
<!--<script src="https://use.typekit.net/bkt6ydm.js"/>-->
<script>try{Typekit.load({ async: true });}catch(e){}</script>
<!-- Language Selector -->
<select class="sel-lang" onchange= "onLanChange(this.options[this.options.selectedIndex].value)">
<option value="0"> 中文 Chinese </option>
<option value="1" selected> 英文 English </option>
</select>
<!-- Chinese Version -->
<div class="zh post-container">
{% capture about_zh %}{% include about/zh.md %}{% endcapture %}
{{ about_zh | markdownify }}
</div>
<!-- English Version -->
<div class="en post-container">
{% capture about_en %}{% include about/en.md %}{% endcapture %}
{{ about_en | markdownify }}
</div>
<!-- Handle Language Change -->
<script type="text/javascript">
// get nodes
var $zh = document.querySelector(".zh");
var $en = document.querySelector(".en");
var $select = document.querySelector("select");
// bind hashchange event
window.addEventListener('hashchange', _render);
// handle render
function _render(){
var _hash = window.location.hash;
// zh
$zh.style.display = "block";
$en.style.display = "none";
if(_hash == "#zh"){
$select.selectedIndex = 0;
}else{
// not trigger onChange, otherwise cause a loop call.
$select.selectedIndex = 1;
// en by default
$en.style.display = "block";
$zh.style.display = "none";
}
}
// handle select change
function onLanChange(index){
if(index == 0){
window.location.hash = "#zh"
}else{
window.location.hash = "#en"
}
}
// init
_render();
</script>
{% if site.disqus_username %}
<!-- disqus 评论框 start -->
<div class="comment">
<div id="disqus_thread" class="disqus-thread">
</div>
</div>
<!-- disqus 评论框 end -->
<!-- disqus 公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = "{{site.disqus_username}}";
var disqus_identifier = "{{site.disqus_username}}/{{page.url}}";
var disqus_url = "{{site.url}}{{page.url}}";
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<!-- disqus 公共JS代码 end -->
{% endif %}