From ecaac79943469b911158e9162097332ce6e4aa8e Mon Sep 17 00:00:00 2001 From: Ulysia Date: Mon, 14 Oct 2024 08:21:45 +0200 Subject: [PATCH] added a custom footer? --- quartz/components/CustomFooter.tsx | 16 +++++++--------- quartz/components/Footer_links.tsx | 8 +++++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/quartz/components/CustomFooter.tsx b/quartz/components/CustomFooter.tsx index 96734bb..7e331f2 100644 --- a/quartz/components/CustomFooter.tsx +++ b/quartz/components/CustomFooter.tsx @@ -1,7 +1,6 @@ import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" import style from "./styles/footer.scss" -import { version } from "../../package.json" -import { i18n } from "../i18n" +import FooterLinksConstructor from "./Footer_links" interface Options { links: Record @@ -9,17 +8,16 @@ interface Options { } export default ((opts?: Options) => { - const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => { - const year = new Date().getFullYear() - const links = opts?.links ?? [] - const rings = opts?.rings ?? [] + const FooterLinks = FooterLinksConstructor(opts) + + const CustomFooter: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => { return (
- Component.Footer_links(links, rings) +
) } - Footer.css = style - return Footer + CustomFooter.css = style + return CustomFooter }) satisfies QuartzComponentConstructor diff --git a/quartz/components/Footer_links.tsx b/quartz/components/Footer_links.tsx index 66fa562..e486d53 100644 --- a/quartz/components/Footer_links.tsx +++ b/quartz/components/Footer_links.tsx @@ -9,11 +9,12 @@ interface Options { } export default ((opts?: Options) => { - const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => { + const FooterLinks: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => { const year = new Date().getFullYear() const links = opts?.links ?? [] const rings = opts?.rings ?? [] return ( +

    {Object.entries(links).map(([text, link]) => ( @@ -40,9 +41,10 @@ export default ((opts?: Options) => {
))} + ) } - Footer.css = style - return Footer + FooterLinks.css = style + return FooterLinks }) satisfies QuartzComponentConstructor