Commit 1e907c3

HPCesia <me@hpcesia.com>
2026-08-15 16:46:22
Add footer component
1 parent e6bc4c3
Changed files (2)
src
components
layouts
src/components/Footer.astro
@@ -0,0 +1,30 @@
+---
+import { SITE_CONFIG } from "@/config";
+---
+<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>
+</footer>
+
+<style lang="scss" is:global>
+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;
+  margin-top: 2rem;
+
+  a {
+    color: inherit;
+    text-decoration: none;
+
+    &:hover {
+      text-decoration-line: underline;
+    }
+  }
+}
+</style>
src/layouts/BaseLayout.astro
@@ -1,6 +1,7 @@
 ---
 import { SITE_CONFIG } from "@/config";
 
+import Footer from "@/components/Footer.astro";
 import Header from "@/components/Header.astro";
 
 import "sanitize.css/sanitize.css";
@@ -38,17 +39,21 @@ const {
     <main>
       <slot />
     </main>
+    <Footer />
   </body>
 </html>
 
 <style lang="scss" is:global>
 body {
+  min-height: 100dvh;
   max-width: 67rem;
   margin-inline: auto;
   padding-inline: 1rem;
+  display: flex;
+  flex-direction: column;
 
   > main {
-    margin-top: 1.75rem;
+    flex: 1;
   }
 }
 </style>