Skip to content

Commit f33932d

Browse files
committed
uiux upgrade
1 parent 396fd35 commit f33932d

3 files changed

Lines changed: 45 additions & 25 deletions

File tree

.github/workflows/lighthouse-ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ jobs:
3838
- name: Run Lighthouse CI
3939
run: npx @lhci/cli@0.13.x autorun --config=.lighthouserc.json
4040

41+
- name: Add Lighthouse report links to summary
42+
if: always()
43+
run: |
44+
node <<'NODE'
45+
const fs = require('fs');
46+
const path = '.lighthouseci/links.json';
47+
if (!fs.existsSync(path)) process.exit(0);
48+
49+
const links = JSON.parse(fs.readFileSync(path, 'utf8'));
50+
let out = '## Lighthouse 臨時報告連結\n\n';
51+
for (const [url, report] of Object.entries(links)) {
52+
out += `- [${url}](${report})\n`;
53+
}
54+
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, out);
55+
NODE
56+
4157
- name: Upload Lighthouse artifacts
4258
if: always()
4359
uses: actions/upload-artifact@v4

.lighthouserc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
}
2020
},
2121
"upload": {
22-
"target": "filesystem",
23-
"outputDir": ".lighthouseci"
22+
"target": "temporary-public-storage"
2423
}
2524
}
2625
}

my-site/_layouts/home.html

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@
44

55
<div class="mag-shell">
66
<header class="mag-masthead">
7-
<p class="edition">Weekend Edition · {{ "now" | date: "%Y-%m-%d" }}</p>
7+
<p class="edition">週末特刊 · {{ "now" | date: "%Y-%m-%d" }}</p>
88
<h1>{{ site.title }}</h1>
99
<p class="deck">{{ site.description }}</p>
10-
<nav class="mast-nav" aria-label="Homepage sections">
11-
<a href="#lead">Top Story</a>
12-
<a href="#headlines">Headlines</a>
13-
<a href="#latest">Latest</a>
14-
<a href="{{ '/archive/' | relative_url }}">Archive</a>
15-
<a href="{{ '/about/' | relative_url }}">About</a>
10+
<nav class="mast-nav" aria-label="首頁區塊">
11+
<a href="#lead">封面故事</a>
12+
<a href="#headlines">焦點新聞</a>
13+
<a href="#latest">最新文章</a>
14+
<a href="{{ '/archive/' | relative_url }}">文章彙整</a>
15+
<a href="{{ '/about/' | relative_url }}">關於本站</a>
1616
</nav>
1717
</header>
1818

1919
<div class="mag-frontpage">
2020
<main class="mag-main">
21-
{% assign featured = site.posts.first %}
21+
{% assign preferred_title = "澳洲 IT 找工實錄|一個普通人的求職歷程" %}
22+
{% assign featured = site.posts | where: "title", preferred_title | first %}
23+
{% unless featured %}
24+
{% assign featured = site.posts.first %}
25+
{% endunless %}
26+
{% assign non_featured_posts = site.posts | where_exp: "post", "post.url != featured.url" %}
2227

2328
{% if featured %}
2429
{% assign featured_parts = featured.content | split: 'src="' %}
@@ -36,17 +41,17 @@ <h1>{{ site.title }}</h1>
3641
</a>
3742
{% endif %}
3843
<div class="lead-copy">
39-
<p class="kicker">Cover Story</p>
44+
<p class="kicker">封面故事</p>
4045
<h2><a href="{{ featured.url | relative_url }}">{{ featured.title }}</a></h2>
4146
<p class="meta">{{ featured.date | date: "%Y-%m-%d" }}{% if featured.author %} · {{ featured.author }}{% endif %}</p>
4247
<p>{{ featured.excerpt | strip_html | normalize_whitespace | truncate: 220 }}</p>
43-
<a class="read-more" href="{{ featured.url | relative_url }}">Read Story</a>
48+
<a class="read-more" href="{{ featured.url | relative_url }}">閱讀全文</a>
4449
</div>
4550
</article>
4651

4752
<div class="lead-side">
48-
<h3>Editor Picks</h3>
49-
{% for post in site.posts offset:1 limit:3 %}
53+
<h3>編輯精選</h3>
54+
{% for post in non_featured_posts limit:3 %}
5055
{% assign side_parts = post.content | split: 'src="' %}
5156
{% if side_parts.size > 1 %}
5257
{% assign side_image = side_parts[1] | split: '"' | first %}
@@ -71,9 +76,9 @@ <h4><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h4>
7176
{% endif %}
7277

7378
<section id="headlines" class="headline-ribbon">
74-
<h3>Headlines</h3>
79+
<h3>焦點新聞</h3>
7580
<ul>
76-
{% for post in site.posts offset:4 limit:6 %}
81+
{% for post in non_featured_posts offset:3 limit:6 %}
7782
<li>
7883
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
7984
<span>{{ post.date | date: "%Y-%m-%d" }}</span>
@@ -84,11 +89,11 @@ <h3>Headlines</h3>
8489

8590
<section id="latest" class="latest-grid">
8691
<div class="section-head">
87-
<h3>Latest Dispatches</h3>
88-
<a href="{{ '/archive/' | relative_url }}" class="section-link">View all</a>
92+
<h3>最新文章</h3>
93+
<a href="{{ '/archive/' | relative_url }}" class="section-link">查看全部</a>
8994
</div>
9095
<div class="post-cards">
91-
{% for post in site.posts offset:10 limit:9 %}
96+
{% for post in non_featured_posts offset:9 limit:9 %}
9297
{% assign card_parts = post.content | split: 'src="' %}
9398
{% if card_parts.size > 1 %}
9499
{% assign card_image = card_parts[1] | split: '"' | first %}
@@ -115,12 +120,12 @@ <h4><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h4>
115120

116121
<aside class="mag-sidebar">
117122
<section class="sidebar-card">
118-
<h3>From the Desk</h3>
119-
<p>Books, films, and life notes from Leo, archived and continuously updated.</p>
123+
<h3>編輯手記</h3>
124+
<p>收錄書籍、電影與生活筆記,持續更新。</p>
120125
</section>
121126

122127
<section class="sidebar-card">
123-
<h3>Recent</h3>
128+
<h3>近期文章</h3>
124129
<ul class="compact-list">
125130
{% for post in site.posts limit:7 %}
126131
<li>
@@ -132,7 +137,7 @@ <h3>Recent</h3>
132137
</section>
133138

134139
<section class="sidebar-card">
135-
<h3>Topics</h3>
140+
<h3>主題分類</h3>
136141
<ul class="topic-cloud">
137142
{% for category in site.categories limit:12 %}
138143
{% assign category_page = site.pages | where: "category_name", category[0] | first %}
@@ -149,11 +154,11 @@ <h3>Topics</h3>
149154
</li>
150155
{% endfor %}
151156
</ul>
152-
<p class="topic-all"><a href="{{ '/categories/' | relative_url }}">Browse all categories</a></p>
157+
<p class="topic-all"><a href="{{ '/categories/' | relative_url }}">瀏覽全部分類</a></p>
153158
</section>
154159

155160
<section class="sidebar-card">
156-
<h3>By Year</h3>
161+
<h3>年度文章</h3>
157162
<ul class="compact-list years">
158163
{% assign posts_by_year = site.posts | group_by_exp: "post", "post.date | date: '%Y'" %}
159164
{% for year in posts_by_year limit:10 %}

0 commit comments

Comments
 (0)