diff --git a/quartz/components/_GithubSource.tsx b/quartz/components/_GithubSource.tsx new file mode 100644 index 000000000..c95a0b89a --- /dev/null +++ b/quartz/components/_GithubSource.tsx @@ -0,0 +1,63 @@ +import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" +import style from "./styles/_githubSource.scss" + +// @ts-ignore +import { classNames } from "../util/lang" + +interface GithubSourceOptions { + repoLink: string + branch: string +} + +const defaultOptions: GithubSourceOptions = { + repoLink: "github.com", + branch: "v4" +} + +export default ((opts?: Partial) => { + // Merge options with defaults + const options: GithubSourceOptions = { ...defaultOptions, ...opts } + const GithubSource: QuartzComponent = ({ + displayClass, + fileData + }: QuartzComponentProps) => { + return ( +
+

Source code

+ +
+ ) + } + GithubSource.css = style + return GithubSource +}) satisfies QuartzComponentConstructor \ No newline at end of file diff --git a/quartz/components/styles/_githubSource.scss b/quartz/components/styles/_githubSource.scss new file mode 100644 index 000000000..e3d6ffc9c --- /dev/null +++ b/quartz/components/styles/_githubSource.scss @@ -0,0 +1,27 @@ +.github-source { + &>h3 { + font-size: 1rem; + margin: 0; + } + + &>ul { + list-style: none; + padding: 0; + margin: 0.5rem 0; + + &>li { + &>a { + background-color: transparent; + } + } + } +} + +.external-icon { + height: 1ex; + margin: 0 0.15em; + + > path { + fill: var(--dark); + } +} \ No newline at end of file