Skip to content

Commit 396fd35

Browse files
committed
seo
1 parent 7a92bb4 commit 396fd35

38 files changed

Lines changed: 123 additions & 101 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Lighthouse CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["main"]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lighthouse:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Ruby
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: "3.4"
24+
25+
- name: Install dependencies
26+
working-directory: my-site
27+
run: bundle install --jobs 4 --retry 3
28+
29+
- name: Build Jekyll (Lighthouse target)
30+
working-directory: my-site
31+
run: bundle exec jekyll build --baseurl ""
32+
33+
- name: Setup Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: "20"
37+
38+
- name: Run Lighthouse CI
39+
run: npx @lhci/cli@0.13.x autorun --config=.lighthouserc.json
40+
41+
- name: Upload Lighthouse artifacts
42+
if: always()
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: lighthouseci-reports
46+
path: .lighthouseci

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ my-site/vendor/
2323
# Optional local env files
2424
.env
2525
.env.*
26+
27+
# Lighthouse local artifacts
28+
.lighthouseci/

.lighthouserc.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"ci": {
3+
"collect": {
4+
"numberOfRuns": 2,
5+
"staticDistDir": "my-site/_site",
6+
"url": [
7+
"http://127.0.0.1:4173/",
8+
"http://127.0.0.1:4173/about/",
9+
"http://127.0.0.1:4173/archive/",
10+
"http://127.0.0.1:4173/categories/"
11+
]
12+
},
13+
"assert": {
14+
"assertions": {
15+
"categories:performance": ["error", { "minScore": 0.9 }],
16+
"categories:accessibility": ["error", { "minScore": 0.9 }],
17+
"categories:best-practices": ["error", { "minScore": 0.9 }],
18+
"categories:seo": ["error", { "minScore": 0.9 }]
19+
}
20+
},
21+
"upload": {
22+
"target": "filesystem",
23+
"outputDir": ".lighthouseci"
24+
}
25+
}
26+
}

my-site/_layouts/category.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
---
44

55
<div class="category-page">
6+
{% assign cat_posts = site.posts | where_exp: "post", "post.categories contains page.category_name" %}
67
<header class="category-header">
7-
<p class="kicker">Category</p>
88
<h1>{{ page.category_name }}</h1>
9-
<p>{{ page.category_count }} posts</p>
9+
<p>{{ cat_posts.size }} posts</p>
1010
</header>
1111

1212
<ul class="category-posts">
13-
{% assign cat_posts = site.posts | where_exp: "post", "post.categories contains page.category_name" %}
1413
{% for post in cat_posts %}
1514
<li>
1615
<span class="meta">{{ post.date | date: "%Y-%m-%d" }}</span>

my-site/_layouts/home.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h1>{{ site.title }}</h1>
3232
<article class="lead-story">
3333
{% if featured_image %}
3434
<a class="lead-media" href="{{ featured.url | relative_url }}" aria-label="{{ featured.title | escape }}">
35-
<img src="{{ featured_image }}" alt="{{ featured.title | escape }}" loading="eager" />
35+
<img src="{{ featured_image }}" alt="{{ featured.title | escape }}" loading="eager" fetchpriority="high" decoding="async" width="1200" height="700" />
3636
</a>
3737
{% endif %}
3838
<div class="lead-copy">
@@ -57,7 +57,7 @@ <h3>Editor Picks</h3>
5757
<article class="mini-story">
5858
{% if side_image %}
5959
<a class="mini-media" href="{{ post.url | relative_url }}" aria-label="{{ post.title | escape }}">
60-
<img src="{{ side_image }}" alt="{{ post.title | escape }}" loading="lazy" />
60+
<img src="{{ side_image }}" alt="{{ post.title | escape }}" loading="lazy" decoding="async" width="92" height="72" />
6161
</a>
6262
{% endif %}
6363
<div>
@@ -99,7 +99,7 @@ <h3>Latest Dispatches</h3>
9999
<article class="post-card">
100100
{% if card_image %}
101101
<a class="card-media" href="{{ post.url | relative_url }}" aria-label="{{ post.title | escape }}">
102-
<img src="{{ card_image }}" alt="{{ post.title | escape }}" loading="lazy" />
102+
<img src="{{ card_image }}" alt="{{ post.title | escape }}" loading="lazy" decoding="async" width="400" height="260" />
103103
</a>
104104
{% endif %}
105105
<div class="card-body">

my-site/_posts/2026-04-24-welcome-to-jekyll.markdown

Lines changed: 0 additions & 29 deletions
This file was deleted.

my-site/assets/main.scss

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
---
33

4-
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Work+Sans:wght@400;500;600;700&display=swap');
54
@import "minima";
65

76
:root {
@@ -19,7 +18,7 @@ body {
1918
linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 16rem),
2019
radial-gradient(circle at 88% 3%, #f1e2d1 0, var(--paper) 52%);
2120
color: var(--ink);
22-
font-family: 'Work Sans', 'Helvetica Neue', sans-serif;
21+
font-family: "Avenir Next", Avenir, "Segoe UI", Roboto, sans-serif;
2322
}
2423

2524
.site-header,
@@ -35,7 +34,11 @@ h3,
3534
h4,
3635
h5,
3736
.post-link {
38-
font-family: 'DM Serif Display', Georgia, serif;
37+
font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
38+
}
39+
40+
.wrapper {
41+
max-width: 1260px;
3942
}
4043

4144
.page-content {
@@ -491,6 +494,10 @@ h5,
491494
}
492495

493496
@media (max-width: 640px) {
497+
.wrapper {
498+
max-width: 100%;
499+
}
500+
494501
.page-content {
495502
padding-top: 1.2rem;
496503
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: category
3-
title: "Category: English book review"
3+
title: "English book review"
44
permalink: /category/english-book-review/
55
category_name: "English book review"
6-
category_count: 4
76
---

my-site/category/人際.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: category
3-
title: "Category: 人際"
3+
title: "人際"
44
permalink: /category/人際/
55
category_name: "人際"
6-
category_count: 1
76
---
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: category
3-
title: "Category: 企業經營與管理"
3+
title: "企業經營與管理"
44
permalink: /category/企業經營與管理/
55
category_name: "企業經營與管理"
6-
category_count: 3
76
---

0 commit comments

Comments
 (0)