Skip to content

Commit

Permalink
components: semantic web for main components
Browse files Browse the repository at this point in the history
  • Loading branch information
vanadium23 committed Nov 29, 2024
1 parent 920fd4e commit 7c49f58
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions quartz/components/ContentMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatDate, getDate } from "./Date"
import { Date, getDate } from "./Date"
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
import readingTime from "reading-time"
import { classNames } from "../util/lang"
Expand Down Expand Up @@ -30,7 +30,7 @@ export default ((opts?: Partial<ContentMetaOptions>) => {
const segments: (string | JSX.Element)[] = []

if (fileData.dates) {
segments.push(formatDate(getDate(cfg, fileData)!, cfg.locale))
segments.push(<Date date={getDate(cfg, fileData)!} locale={cfg.locale} />)
}

// Display reading time if enabled
Expand Down
2 changes: 1 addition & 1 deletion quartz/components/Date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export function formatDate(d: Date, locale: ValidLocale = "en-US"): string {
}

export function Date({ date, locale }: Props) {
return <>{formatDate(date, locale)}</>
return <time datetime={date.toISOString()}>{formatDate(date, locale)}</time>
}
4 changes: 2 additions & 2 deletions quartz/components/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ export default ((userOpts?: Partial<Options>) => {
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<div id="explorer-content">
<nav id="explorer-content">
<ul class="overflow" id="explorer-ul">
<ExplorerNode node={fileTree} opts={opts} fileData={fileData} />
<li id="explorer-end" />
</ul>
</div>
</nav>
</div>
)
}
Expand Down
12 changes: 6 additions & 6 deletions quartz/components/renderPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,19 @@ export function renderPage(
const Body = BodyConstructor()

const LeftComponent = (
<div class="left sidebar">
<aside class="left sidebar">
{left.map((BodyComponent) => (
<BodyComponent {...componentData} />
))}
</div>
</aside>
)

const RightComponent = (
<div class="right sidebar">
<aside class="right sidebar">
{right.map((BodyComponent) => (
<BodyComponent {...componentData} />
))}
</div>
</aside>
)

const lang = componentData.fileData.frontmatter?.lang ?? cfg.locale?.split("-")[0] ?? "en"
Expand All @@ -230,7 +230,7 @@ export function renderPage(
</Header>
<Body {...componentData}>
{LeftComponent}
<div class="center">
<main class="center">
<div class="page-header">
<div class="popover-hint">
{beforeBody.map((BodyComponent) => (
Expand All @@ -245,7 +245,7 @@ export function renderPage(
<BodyComponent {...componentData} />
))}
</div>
</div>
</main>
{RightComponent}
<Footer {...componentData} />
</Body>
Expand Down

0 comments on commit 7c49f58

Please sign in to comment.