Commit 871a458

HPCesia <me@hpcesia.com>
2026-09-19 16:10:11
footer: add more info
1 parent 7389fb1
Changed files (4)
src/components/Footer.astro
@@ -1,9 +1,24 @@
 ---
+import { getIntlayer, type Locale } from "intlayer";
+
 import { SITE_CONFIG } from "@/config";
+import { getRelativeLocaleUrl } from "@/utils/url.ts";
+
+const locale = Astro.currentLocale! as Locale;
+const globalI18n = getIntlayer("global", locale);
 ---
 <footer class="footer">
-  <div>Copyright © {new Date().getFullYear()} {SITE_CONFIG.author}</div>
-  <div>Powered by <a href="https://astro.build/">Astro</a> and <a href="https://typst.app/">Typst</a></div>
+  <div class="footer-alternatives">
+    <a href={getRelativeLocaleUrl("/feed.atom", locale).slice(0, -1)}>
+      {globalI18n.feed}
+    </a>
+    <a href="https://git.trin.one/HPCesia/kerplunk">{globalI18n.source}</a>
+  </div>
+  <div class="footer-colophon">
+    <span>Copyright © {new Date().getFullYear()} {SITE_CONFIG.author}</span>
+    <span>Powered by <a href="https://astro.build/">Astro</a> and <a href="https://typst.app/">Typst</a></span>
+    <span>Theme <a href="https://git.trin.one/HPCesia/kerplunk">Kerplunk</a></span>
+  </div>
 </footer>
 
 <style lang="scss" is:global>
@@ -12,13 +27,28 @@ footer.footer {
   border-top: 0.1rem;
   border-top-style: solid;
   display: flex;
-  flex-wrap: wrap;
   gap: 1rem;
   justify-content: space-between;
   align-items: baseline;
-  padding-block: 0.25rem 0.5rem;
+  padding-block: 0.5rem 1rem;
   margin-top: 2rem;
 
+  @media (max-width:48rem) {
+    flex-direction: column;
+  }
+
+  .footer-alternatives,
+  .footer-colophon {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 1rem;
+
+    @media (max-width:48rem) {
+      width: 100%;
+      justify-content: center;
+    }
+  }
+
   &::before {
     content: "";
     position: absolute;
src/components/Header.astro
@@ -11,7 +11,7 @@ interface Props {
 }
 
 const { availableLocales } = Astro.props;
-const locale = Astro.currentLocale!;
+const locale = Astro.currentLocale! as Locale;
 const globalI18n = getIntlayer("global", locale);
 ---
 <header class="header">
@@ -21,7 +21,7 @@ const globalI18n = getIntlayer("global", locale);
     <ul>
       <li><a href={getRelativeLocaleUrl("/posts", locale)}>{globalI18n.posts}</a></li>
       <li><a href={getRelativeLocaleUrl("/about", locale)}>{globalI18n.about}</a></li>
-      <li><a href={getRelativeLocaleUrl("/feed.atom", locale).slice(0, -1)}>{globalI18n.feed}</a></li>
+      <li><a href={getRelativeLocaleUrl("/links", locale)}>{globalI18n.friendLinks}</a></li>
     </ul>
     <LocaleSwitcher availableLocales={availableLocales} />
   </nav>
src/contents/about/avatar.png
Binary file
src/globalI18n.content.ts
@@ -6,6 +6,7 @@ interface Content {
   about: string;
   recentPosts: string;
   feed: string;
+  source: string;
   language: string;
   description: string;
 }
@@ -29,6 +30,10 @@ export default {
       en: "Feed",
       "zh-CN": "订阅",
     }),
+    source: t({
+      en: "Source",
+      "zh-CN": "源代码",
+    }),
     language: t({
       en: "Language",
       "zh-CN": "语言",