quartz/quartz/components/Footer.tsx
jyje dd00c8580c Merge branch 'main' into develop
# Conflicts:
#	.github/workflows/ci.yaml
#	quartz.config.ts
#	quartz/components/Footer.tsx
#	quartz/components/scripts/popover.inline.ts
2024-10-03 15:13:08 +09:00

41 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
import style from "./styles/footer.scss"
import { version } from "../../package.json"
import { i18n } from "../i18n"
interface Options {
links: Record<string, string>
}
export default ((opts?: Options) => {
const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
const beginYear = 2022
const year = new Date().getFullYear()
const links = opts?.links ?? []
return (
<footer class={`${displayClass ?? ""}`}>
<p>
{i18n(cfg.locale).components.footer.createdWith}{" "}
<a href="https://jyje.live">jyje.live</a>
{" "}©{" "}{beginYear}-{year}.{" "}
{i18n(cfg.locale).components.footer.poweredBy}{" "}
<a href="https://quartz.jzhao.xyz">Quartz v{version}</a>
{" "}and{" "}
<a href="https://pages.github.com">GitHub Pages</a>
{" "}with .
</p>
<ul>
{Object.entries(links).map(([text, link]) => (
<li>
<a href={link}>{text}</a>
</li>
))}
</ul>
</footer>
)
}
Footer.css = style
return Footer
}) satisfies QuartzComponentConstructor