Skip to content

Commit f1b7ce1

Browse files
committed
refactor: redesign footer with multi-column layout, quick links, and i18n
1 parent 7ed239c commit f1b7ce1

13 files changed

Lines changed: 70 additions & 28 deletions

File tree

src/components/Footer.astro

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,69 @@
11
---
22
import wechatQr from "../assets/wechat-qrcode.jpg";
3+
import { t } from "../i18n/utils.ts";
4+
5+
interface Props {
6+
locale?: "zh" | "en";
7+
}
8+
9+
const { locale = "zh" } = Astro.props;
10+
const prefix = locale === "en" ? "/en" : "";
311
---
412

513
<footer class="border-t border-border mt-auto">
614
<div class="max-w-[1100px] mx-auto px-4 sm:px-6 py-6 sm:py-8">
7-
<!-- WeChat Subscribe -->
8-
<div class="flex flex-col sm:flex-row items-center gap-5 sm:gap-8 mb-6 sm:mb-8 pb-6 sm:pb-8 border-b border-border">
9-
<img
10-
src={wechatQr.src}
11-
alt="微信公众号二维码"
12-
class="w-32 h-32 sm:w-36 sm:h-36 rounded-xl object-cover shadow-[0_8px_30px_rgba(99,102,241,0.10)] border border-border flex-shrink-0"
13-
loading="lazy"
14-
/>
15-
<div class="text-center sm:text-left">
16-
<h3 class="text-base sm:text-lg font-semibold mb-1.5">微信扫码关注</h3>
17-
<p class="text-text-dim text-sm leading-relaxed">每日推送直达,不错过任何重要资讯</p>
15+
<!-- Top: Quick Links + WeChat -->
16+
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-6 sm:gap-8 mb-6 sm:mb-8 pb-6 sm:pb-8 border-b border-border">
17+
<!-- Content -->
18+
<div>
19+
<h4 class="text-xs font-semibold text-text-muted uppercase tracking-wider mb-2.5 sm:mb-3">{t("nav.industry", locale)}</h4>
20+
<ul class="space-y-2 text-sm">
21+
<li><a href={`${prefix}/daily`} class="text-text-dim hover:text-accent-light transition-colors no-underline">{t("nav.daily", locale)}</a></li>
22+
<li><a href={`${prefix}/weekly`} class="text-text-dim hover:text-accent-light transition-colors no-underline">{t("nav.weekly", locale)}</a></li>
23+
<li><a href={`${prefix}/topics`} class="text-text-dim hover:text-accent-light transition-colors no-underline">{t("nav.topics", locale)}</a></li>
24+
</ul>
25+
</div>
26+
<!-- Rankings -->
27+
<div>
28+
<h4 class="text-xs font-semibold text-text-muted uppercase tracking-wider mb-2.5 sm:mb-3">{t("nav.rankings", locale)}</h4>
29+
<ul class="space-y-2 text-sm">
30+
<li><a href={`${prefix}/ai/tools/coding`} class="text-text-dim hover:text-accent-light transition-colors no-underline">{t("rankings.categories.coding", locale)}</a></li>
31+
<li><a href={`${prefix}/ai/tools/writing`} class="text-text-dim hover:text-accent-light transition-colors no-underline">{t("rankings.categories.writing", locale)}</a></li>
32+
<li><a href={`${prefix}/ai/tools/agent`} class="text-text-dim hover:text-accent-light transition-colors no-underline">{t("rankings.categories.agent", locale)}</a></li>
33+
</ul>
1834
</div>
35+
<!-- More -->
36+
<div class="hidden sm:block">
37+
<h4 class="text-xs font-semibold text-text-muted uppercase tracking-wider mb-2.5 sm:mb-3">{locale === "en" ? "More" : "更多"}</h4>
38+
<ul class="space-y-2 text-sm">
39+
<li><a href={`${prefix}/search`} class="text-text-dim hover:text-accent-light transition-colors no-underline">{t("nav.search", locale)}</a></li>
40+
<li><a href="https://github.com/doocs/awesome-ai" target="_blank" rel="noopener" class="text-text-dim hover:text-accent-light transition-colors no-underline">{locale === "en" ? "Contribute" : "贡献"}</a></li>
41+
<li><a href="https://github.com/doocs/awesome-ai/blob/main/LICENSE" target="_blank" rel="noopener" class="text-text-dim hover:text-accent-light transition-colors no-underline">MIT License</a></li>
42+
</ul>
43+
</div>
44+
<!-- WeChat (spans 2 cols on lg) -->
45+
<div class="col-span-2 lg:col-span-2 flex items-center gap-4 sm:gap-5">
46+
<img
47+
src={wechatQr.src}
48+
alt="WeChat QR"
49+
class="w-20 h-20 sm:w-24 sm:h-24 rounded-lg object-cover shadow-[0_4px_20px_rgba(99,102,241,0.08)] border border-border flex-shrink-0"
50+
loading="lazy"
51+
/>
52+
<div>
53+
<h4 class="text-sm font-semibold mb-1">{locale === "en" ? "Follow on WeChat" : "微信扫码关注"}</h4>
54+
<p class="text-text-dim text-xs leading-relaxed">{locale === "en" ? "Daily updates delivered to your chat" : "每日推送直达,不错过重要资讯"}</p>
55+
</div>
56+
</div>
57+
</div>
58+
<!-- Bottom -->
59+
<div class="flex flex-col sm:flex-row items-center justify-between gap-3 text-xs text-text-muted">
60+
<p class="text-center sm:text-left">
61+
{locale === "en" ? "Extracting real signals from the AI noise" : "不做信息搬运工,只做有价值的筛选和分析"}
62+
</p>
63+
<p>
64+
Copyright &copy; <span id="footer-year"></span> <a href="https://github.com/doocs" class="text-accent-light no-underline hover:underline" target="_blank" rel="noopener">Doocs</a>
65+
</p>
1966
</div>
20-
<!-- Copyright -->
21-
<p class="text-center text-xs sm:text-sm text-text-muted">
22-
Copyright &copy; <span id="footer-year"></span> <a href="https://github.com/doocs" class="text-accent-light no-underline hover:underline" target="_blank" rel="noopener">Doocs</a>
23-
· Licensed under <a href="https://github.com/doocs/awesome-ai/blob/main/LICENSE" class="text-accent-light no-underline hover:underline" target="_blank" rel="noopener">MIT License</a>
24-
</p>
2567
</div>
2668
</footer>
2769
<script>

src/layouts/BaseLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ const currentLocale = getLocaleFromUrl(currentUrl);
3030
<slot />
3131
</main>
3232

33-
<Footer />
33+
<Footer locale={currentLocale} />
3434
</Head>

src/layouts/ContentLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ const { title, description, locale, currentPath } = Astro.props;
3838
</slot>
3939
<NavBar locale={locale} currentPath={currentPath} />
4040
<slot />
41-
<Footer />
41+
<Footer locale={locale} />
4242
</Head>

src/pages/ai/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function getModelBySlug(slug: string) {
8585
</div>
8686
</main>
8787

88-
<Footer />
88+
<Footer locale="zh" />
8989

9090
<script is:inline>
9191
function switchTab(tab) {

src/pages/daily/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ const sorted = allDaily.sort((a, b) => b.data.date.localeCompare(a.data.date));
2424
))}
2525
</div>
2626
</main>
27-
<Footer />
27+
<Footer locale="zh" />
2828
</Head>

src/pages/en/ai/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function getModelBySlug(slug) {
8484
</div>
8585
</main>
8686

87-
<Footer />
87+
<Footer locale="en" />
8888

8989
<script is:inline>
9090
function switchTab(tab) {

src/pages/en/daily/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ const sorted = allDaily.sort((a, b) => b.data.date.localeCompare(a.data.date));
2424
))}
2525
</div>
2626
</main>
27-
<Footer />
27+
<Footer locale="en" />
2828
</Head>

src/pages/en/industry/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ const items = [
5555
))}
5656
</div>
5757
</main>
58-
<Footer />
58+
<Footer locale="en" />
5959
</Head>

src/pages/en/topics/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ const sorted = allTopics.sort((a, b) => b.data.date.localeCompare(a.data.date));
4545
})}
4646
</div>
4747
</main>
48-
<Footer />
48+
<Footer locale="en" />
4949
</Head>

src/pages/en/weekly/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ const sorted = allWeekly.sort((a, b) => b.data.date.localeCompare(a.data.date));
2525
))}
2626
</div>
2727
</main>
28-
<Footer />
28+
<Footer locale="en" />
2929
</Head>

0 commit comments

Comments
 (0)