-
-
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
11 changed files
with
77 additions
and
58 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
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 |
---|---|---|
@@ -1,20 +1,10 @@ | ||
import { resolveToRoot } from "../path" | ||
import Darkmode from "./Darkmode" | ||
import style from './styles/header.scss' | ||
import { QuartzComponentProps } from "./types" | ||
|
||
export interface HeaderProps { | ||
title: string | ||
slug: string | ||
} | ||
|
||
export default function Header({ title, slug }: HeaderProps) { | ||
const baseDir = resolveToRoot(slug) | ||
export default function Header({ children }: QuartzComponentProps) { | ||
return <header> | ||
<h1><a href={baseDir}>{title}</a></h1> | ||
<div class="spacer"></div> | ||
<Darkmode /> | ||
{children} | ||
</header> | ||
} | ||
|
||
Header.beforeDOMLoaded = Darkmode.beforeDOMLoaded | ||
Header.css = style + Darkmode.css | ||
Header.css = style |
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,9 @@ | ||
import { resolveToRoot } from "../path" | ||
import { QuartzComponentProps } from "./types" | ||
|
||
export default function({ cfg, fileData }: QuartzComponentProps) { | ||
const title = cfg.siteTitle | ||
const slug = fileData.slug! | ||
const baseDir = resolveToRoot(slug) | ||
return <h1><a href={baseDir}>{title}</a></h1> | ||
} |
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,3 @@ | ||
export default function() { | ||
return <div class="spacer"></div> | ||
} |
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
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