generated from jackyzha0/quartz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { QuartzComponentConstructor, QuartzComponentProps } from "./types" | ||
import { FullSlug, SimpleSlug, resolveRelative } from "../util/path" | ||
import { QuartzPluginData } from "../plugins/vfile" | ||
import { byDateAndAlphabetical } from "./PageList" | ||
import style from "./styles/links.scss" | ||
import { Date, getDate } from "./Date" | ||
import { GlobalConfiguration } from "../cfg" | ||
|
||
interface Options { | ||
title: string | ||
} | ||
|
||
const defaultOptions = (cfg: GlobalConfiguration): Options => ({ | ||
title: "", | ||
}) | ||
|
||
export default ((userOpts?: Partial<Options>) => { | ||
function Links({ allFiles, fileData, displayClass, cfg }: QuartzComponentProps) { | ||
const opts = { ...defaultOptions(cfg), ...userOpts } | ||
return ( | ||
<div class={`links ${displayClass ?? ""}`}> | ||
<h3>{opts.title}</h3> | ||
<ul> | ||
<li> | ||
<h3 style={{marginTop: 0, marginBottom: 0}}><a href="/notes">Notes</a></h3> | ||
<i>where I share what I've learned</i> | ||
</li> | ||
<li> | ||
<h3 style={{marginTop: 0, marginBottom: 0}}><a href="/life">Life</a></h3> | ||
<i>where I write about my adventures</i> | ||
</li> | ||
<li> | ||
<h3 style={{marginTop: 0, marginBottom: 0}}><a href="/posts">Posts</a></h3> | ||
<i>my longer form thoughts</i> | ||
</li> | ||
<li> | ||
<h3 style={{marginTop: 0, marginBottom: 0}}><a href="/projects">Projects</a></h3> | ||
<i>cool things I've made</i> | ||
</li> | ||
</ul> | ||
</div> | ||
) | ||
} | ||
|
||
Links.css = style | ||
return Links | ||
}) satisfies QuartzComponentConstructor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.links { | ||
ul { | ||
list-style: none; | ||
margin-top: 1rem; | ||
padding-left: 0; | ||
|
||
& > li { | ||
margin: 1rem 0; | ||
.section > .desc > h3 > a { | ||
background-color: transparent; | ||
} | ||
|
||
.section > .meta { | ||
margin: 0 0 0.5rem 0; | ||
opacity: 0.6; | ||
} | ||
} | ||
} | ||
} |