forked from jackyzha0/quartz
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the About page; Added an AuthorImage component for it; Edited a…
…ssociated components
- Loading branch information
1 parent
d66ba98
commit 9f0b661
Showing
11 changed files
with
157 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
|
||
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur | ||
|
||
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. |
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 @@ | ||
import { classNames } from "../util/lang"; | ||
import { QuartzComponentConstructor, QuartzComponentProps } from "./types" | ||
|
||
export default (() => { | ||
function AuthorImage({ displayClass, cfg }: QuartzComponentProps) { | ||
const { landingPageData: { authorImageUrl, authorName } } = cfg; | ||
|
||
return ( | ||
<img class={classNames(displayClass, "author-img")} src={`../../static/${authorImageUrl}`} alt={`Photo of ${authorName}`} /> | ||
) | ||
} | ||
AuthorImage.css = ` | ||
.author-img { | ||
margin: 0; | ||
} | ||
` | ||
|
||
return AuthorImage | ||
}) 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
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,19 +1,32 @@ | ||
import { QuartzComponentConstructor, QuartzComponentProps } from "./types" | ||
import { classNames } from "../util/lang" | ||
|
||
function Title({ fileData, displayClass }: QuartzComponentProps) { | ||
const title = fileData.frontmatter?.title | ||
interface Options { | ||
useConfig?: boolean | ||
} | ||
|
||
export default ((opts?: Options) => { | ||
function Title({ fileData, displayClass, cfg }: QuartzComponentProps) { | ||
const options = opts; | ||
let title = undefined; | ||
|
||
if (options && options.useConfig) { | ||
title = cfg.landingPageData.authorName; | ||
} else { | ||
title = fileData.frontmatter?.title; | ||
} | ||
|
||
if (title) { | ||
return <h1 class={classNames(displayClass, "title")}>{title}</h1> | ||
} else { | ||
return null | ||
if (title) { | ||
return <h1 class={classNames(displayClass, "title")}>{title}</h1> | ||
} else { | ||
return null | ||
} | ||
} | ||
} | ||
Title.css = ` | ||
.title { | ||
margin: 0; | ||
} | ||
` | ||
Title.css = ` | ||
.title { | ||
margin: 0; | ||
} | ||
` | ||
|
||
export default (() => Title) satisfies QuartzComponentConstructor | ||
return Title | ||
}) 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
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,3 +1,19 @@ | ||
@use "./base.scss"; | ||
|
||
// put your custom CSS here! | ||
|
||
.article-and-author-img { | ||
article { | ||
flex: 2; | ||
} | ||
|
||
img { | ||
@media only screen and (min-width: 768px) { | ||
flex: 1; | ||
} | ||
|
||
@media only screen and (max-width: 768px) { | ||
width: 100%; | ||
} | ||
} | ||
} |
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,5 +1,8 @@ | ||
// Function that gets the initials of the name | ||
export function getInitials(name: string) { | ||
let initials = name.match(/\b\w/g) || [] | ||
return ((initials.shift() || '') + (initials.pop() || '')).toUpperCase() | ||
} | ||
|
||
export function getWhatIDoStr(whatIDoArray: string[]) { | ||
return `${whatIDoArray.slice(0, whatIDoArray.length - 1).join(", ")}, and a ${ whatIDoArray[whatIDoArray.length - 1]}` | ||
} |