Skip to content

Commit 9d6648b

Browse files
committed
fix(index): correct HTML structure
1 parent 77c0c5e commit 9d6648b

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

index.html

+18-14
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<select id="sort-select">
1212
<option value="author-picks|all">Picks</option>
1313
<option value="date-desc|all">All</option>
14-
<option value="date-desc|original" selected>Original</option>
15-
<option value="date-desc|en">English</option>
14+
<option value="date-desc|original">Original</option>
15+
<option value="date-desc|en" selected>English</option>
1616
<option value="date-desc|zh">中文</option>
1717
<option value="date-desc|ja">日本語</option>
1818
<option value="date-desc|es">Español</option>
@@ -29,30 +29,34 @@
2929
{% if site.posts.size > 0 %}
3030
{% for post in site.posts %}
3131
{% assign translated = post.translated %}
32+
{% assign generated = post.generated %}
3233
{% if translated == nil %}
3334
{% assign translated = false %}
3435
{% endif %}
36+
{% if generated == nil %}
37+
{% assign generated = false %}
38+
{% endif %}
3539
{% if post.path contains '_posts/en/' %}
36-
<li class="list-group-item post-item lang-en" data-top="{{ post.top }}" data-translated="{{ translated }}">
40+
<li class="list-group-item post-item lang-en" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
3741
{% elsif post.path contains '_posts/zh/' %}
38-
<li class="list-group-item post-item lang-zh" data-top="{{ post.top }}" data-translated="{{ translated }}">
42+
<li class="list-group-item post-item lang-zh" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
3943
{% elsif post.path contains '_posts/ja/' %}
40-
<li class="list-group-item post-item lang-ja" data-top="{{ post.top }}" data-translated="{{ translated }}">
44+
<li class="list-group-item post-item lang-ja" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
4145
{% elsif post.path contains '_posts/es/' %}
42-
<li class="list-group-item post-item lang-es" data-top="{{ post.top }}" data-translated="{{ translated }}">
46+
<li class="list-group-item post-item lang-es" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
4347
{% elsif post.path contains '_posts/hi/' %}
44-
<li class="list-group-item post-item lang-hi" data-top="{{ post.top }}" data-translated="{{ translated }}">
48+
<li class="list-group-item post-item lang-hi" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
4549
{% elsif post.path contains '_posts/fr/' %}
46-
<li class="list-group-item post-item lang-fr" data-top="{{ post.top }}" data-translated="{{ translated }}">
50+
<li class="list-group-item post-item lang-fr" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
4751
{% elsif post.path contains '_posts/de/' %}
48-
<li class="list-group-item post-item lang-de" data-top="{{ post.top }}" data-translated="{{ translated }}">
52+
<li class="list-group-item post-item lang-de" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
4953
{% elsif post.path contains '_posts/ar/' %}
50-
<li class="list-group-item post-item lang-ar" data-top="{{ post.top }}" data-translated="{{ translated }}">
54+
<li class="list-group-item post-item lang-ar" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
5155
{% elsif post.path contains '_posts/hant/' %}
52-
<li class="list-group-item post-item lang-hant" data-top="{{ post.top }}" data-translated="{{ translated }}">
56+
<li class="list-group-item post-item lang-hant" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
5357
{% elsif post.path contains '_posts/original/' %}
5458
{% else %}
55-
<li class="list-group-item post-item lang-all" data-top="{{ post.top }}" data-translated="{{ translated }}">
59+
<li class="list-group-item post-item lang-all" data-top="{{ post.top }}" data-translated="{{ translated }}" data-generated="{{ generated }}">
5660
{% endif %}
5761
{% if post.path contains '_posts/en/' or post.path contains '_posts/zh/' or post.path contains '_posts/ja/' or post.path contains '_posts/es/' or post.path contains '_posts/hi/' or post.path contains '_posts/fr/' or post.path contains '_posts/de/' or post.path contains '_posts/ar/' or post.path contains '_posts/hant/' or post.path contains '_posts/all/' %}
5862
<a href="{{ post.url }}">
@@ -100,7 +104,7 @@
100104
}).map(post => ({ element: post }));
101105
} else if (sortOption === 'date-desc' && langFilter === 'original') {
102106
processedPosts = Array.from(posts)
103-
.filter(post => post.dataset.translated === 'false')
107+
.filter(post => post.dataset.translated === 'false' && post.dataset.generated === 'false')
104108
.map(post => {
105109
const dateElement = post.querySelector('.date');
106110
const dateStr = dateElement ? dateElement.textContent.trim().replace(/\./g, '-') : null;
@@ -172,7 +176,7 @@
172176
if (savedSort) {
173177
sortSelect.value = savedSort;
174178
} else {
175-
sortSelect.value = 'date-desc|original';
179+
sortSelect.value = 'date-desc|en';
176180
}
177181

178182
updatePosts();

0 commit comments

Comments
 (0)