| |
| import fs from "node:fs"; |
| import path from "node:path"; |
| import { footerConfig, profileConfig } from "@/config"; |
| import { url } from "@/utils/url-utils"; |
|
|
| const currentYear = new Date().getFullYear(); |
|
|
| let customFooterHtml = footerConfig.customHtml?.trim() || ""; |
| if (!customFooterHtml && footerConfig.enable) { |
| try { |
| const footerConfigPath = path.join( |
| process.cwd(), |
| "src", |
| "config", |
| "FooterConfig.html", |
| ); |
| customFooterHtml = fs.readFileSync(footerConfigPath, "utf-8"); |
| customFooterHtml = customFooterHtml.replace(/<! |
| } catch (error) { |
| console.warn("FooterConfig.html read failed:", error.message); |
| } |
| } |
| |
|
|
| <div |
| class="transition border-t border-black/10 dark:border-white/15 my-10 border-dashed mx-32" |
| > |
| </div> |
|
|
| <div |
| class="transition border-dashed border-[oklch(85%_0.01_var(--hue))] dark:border-white/15 rounded-2xl mb-12 flex flex-col items-center justify-center px-6" |
| > |
| <div class="transition text-50 text-sm text-center"> |
| <div class="mb-2"> |
| {customFooterHtml && <div set:html={customFooterHtml} />} |
| </div> |
| <div class="m-0.5"> |
| © <span id="copyright-year">{currentYear}</span> |
| {profileConfig.name}. All Rights Reserved. / |
| <a |
| class="transition link text-(--primary) font-medium" |
| target="_blank" |
| href={url("rss.xml")}>RSS</a |
| > / |
| <a |
| class="transition link text-(--primary) font-medium" |
| target="_blank" |
| href={url("sitemap-index.xml")}>Sitemap</a |
| > |
| </div> |
| <div class="m-0.5"> |
| Powered by |
| <a |
| class="transition link text-(--primary) font-medium" |
| target="_blank" |
| href="https://astro.build">Astro</a |
| > & |
| <a |
| class="transition link text-(--primary) font-medium" |
| target="_blank" |
| href="https://github.com/CuteLeaf/Firefly">Firefly</a |
| > |
| </div> |
| </div> |
| </div> |
|
|