2024-02-13 23:53:44 -05:00
|
|
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
2023-07-01 00:03:01 -07:00
|
|
|
import style from "./styles/footer.scss"
|
2023-07-22 17:27:41 -07:00
|
|
|
import { version } from "../../package.json"
|
2024-02-04 20:57:10 -08:00
|
|
|
import { i18n } from "../i18n"
|
2023-07-01 00:03:01 -07:00
|
|
|
|
|
|
|
interface Options {
|
|
|
|
links: Record<string, string>
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ((opts?: Options) => {
|
2024-02-13 23:53:44 -05:00
|
|
|
const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
|
2023-07-01 00:03:01 -07:00
|
|
|
const year = new Date().getFullYear()
|
|
|
|
const links = opts?.links ?? []
|
2023-07-22 17:27:41 -07:00
|
|
|
return (
|
2023-10-02 02:20:55 +02:00
|
|
|
<footer class={`${displayClass ?? ""}`}>
|
2023-07-22 17:27:41 -07:00
|
|
|
<p>
|
2024-02-04 20:57:10 -08:00
|
|
|
{i18n(cfg.locale).components.footer.createdWith}{" "}
|
|
|
|
<a href="https://quartz.jzhao.xyz/">Quartz v{version}</a> © {year}
|
2023-07-22 17:27:41 -07:00
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
{Object.entries(links).map(([text, link]) => (
|
|
|
|
<li>
|
|
|
|
<a href={link}>{text}</a>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</footer>
|
|
|
|
)
|
2023-07-01 00:03:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
Footer.css = style
|
|
|
|
return Footer
|
|
|
|
}) satisfies QuartzComponentConstructor
|