added a custom footer?

This commit is contained in:
Ulysia 2024-10-14 08:21:45 +02:00
parent be453f9d74
commit ecaac79943
2 changed files with 12 additions and 12 deletions

View file

@ -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<string, string>
@ -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 (
<footer class={`${displayClass ?? ""}`}>
Component.Footer_links(links, rings)
<FooterLinks displayClass={displayClass} cfg={cfg} />
</footer>
)
}
Footer.css = style
return Footer
CustomFooter.css = style
return CustomFooter
}) satisfies QuartzComponentConstructor

View file

@ -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 (
<div>
<hr />
<ul>
{Object.entries(links).map(([text, link]) => (
@ -40,9 +41,10 @@ export default ((opts?: Options) => {
</div>
))}
</div>
</div>
)
}
Footer.css = style
return Footer
FooterLinks.css = style
return FooterLinks
}) satisfies QuartzComponentConstructor