|
11 | 11 | <select id="sort-select">
|
12 | 12 | <option value="author-picks|all">Picks</option>
|
13 | 13 | <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> |
16 | 16 | <option value="date-desc|zh">中文</option>
|
17 | 17 | <option value="date-desc|ja">日本語</option>
|
18 | 18 | <option value="date-desc|es">Español</option>
|
|
29 | 29 | {% if site.posts.size > 0 %}
|
30 | 30 | {% for post in site.posts %}
|
31 | 31 | {% assign translated = post.translated %}
|
| 32 | + {% assign generated = post.generated %} |
32 | 33 | {% if translated == nil %}
|
33 | 34 | {% assign translated = false %}
|
34 | 35 | {% endif %}
|
| 36 | + {% if generated == nil %} |
| 37 | + {% assign generated = false %} |
| 38 | + {% endif %} |
35 | 39 | {% 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 }}"> |
37 | 41 | {% 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 }}"> |
39 | 43 | {% 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 }}"> |
41 | 45 | {% 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 }}"> |
43 | 47 | {% 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 }}"> |
45 | 49 | {% 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 }}"> |
47 | 51 | {% 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 }}"> |
49 | 53 | {% 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 }}"> |
51 | 55 | {% 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 }}"> |
53 | 57 | {% elsif post.path contains '_posts/original/' %}
|
54 | 58 | {% 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 }}"> |
56 | 60 | {% endif %}
|
57 | 61 | {% 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/' %}
|
58 | 62 | <a href="{{ post.url }}">
|
|
100 | 104 | }).map(post => ({ element: post }));
|
101 | 105 | } else if (sortOption === 'date-desc' && langFilter === 'original') {
|
102 | 106 | processedPosts = Array.from(posts)
|
103 |
| - .filter(post => post.dataset.translated === 'false') |
| 107 | + .filter(post => post.dataset.translated === 'false' && post.dataset.generated === 'false') |
104 | 108 | .map(post => {
|
105 | 109 | const dateElement = post.querySelector('.date');
|
106 | 110 | const dateStr = dateElement ? dateElement.textContent.trim().replace(/\./g, '-') : null;
|
|
172 | 176 | if (savedSort) {
|
173 | 177 | sortSelect.value = savedSort;
|
174 | 178 | } else {
|
175 |
| - sortSelect.value = 'date-desc|original'; |
| 179 | + sortSelect.value = 'date-desc|en'; |
176 | 180 | }
|
177 | 181 |
|
178 | 182 | updatePosts();
|
|
0 commit comments