-
Notifications
You must be signed in to change notification settings - Fork 123
/
what's-new.html
87 lines (83 loc) · 2.38 KB
/
what's-new.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
---
layout: post
title: What's New
redirect_from: /What's-New/
---
<div id="other-langs" style="display:none">
{% for post in site.posts %}
{% if post.url contains '/zh/' %}
<span data-title="{{ post.title }}" data-href="{{ post.url }}" ><a itemprop="name" href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></span>
{% endif %}
{% endfor %}
</div>
<div id="list-contents">
<h3>Change Log</h3>
<ul class="category basic-posts">
{% assign result = site.categories.draftnew %} {% assign result = result |
concat: site.categories.new %} {% for post in result %} {% unless post.draft
%} {% assign title = post.title %}
<li>
<div class="article">
<article
class="article"
itemscope
itemtype="http://schema.org/BlogPosting"
>
<header class="post-header">
<span class="title"
><a
itemprop="name"
href="{{ post.url }}"
title="{{ title }}"
>{{ title }}</a
></span
>
<time class="date">{{ post.date | date: "%Y-%m-%d" }}</time>
</header>
</article>
</div>
</li>
{% endunless %} {% endfor %}
</ul>
<h3>News / Announcements</h3>
<ul class="category basic-posts">
{% for post in site.categories.announcement %} {% unless post.draft %} {%
assign title = post.title %}
<li>
<div class="article">
<article
class="article"
itemscope
itemtype="http://schema.org/BlogPosting"
>
<header class="post-header">
<span class="title"
><a
itemprop="name"
href="{{ post.url }}"
title="{{ title }}"
>{{ title }}</a
></span
>
<time class="date">{{ post.date | date: "%Y-%m-%d" }}</time>
</header>
</article>
</div>
</li>
{% endunless %} {% endfor %}
</ul>
</div>
<script>
var langDom = document.querySelector("#other-langs");
if(location.host.indexOf(".cn") > -1) {
document.querySelectorAll(".title").forEach(t => {
var href = t.querySelector("a").getAttribute("href");
var cnSpan = href && langDom.querySelector(`[data-href="/zh${href}"]`);
if(cnSpan) {
t.innerHTML = cnSpan.innerHTML;
}
});
} else {
langDom.remove();
}
</script>