Swap the default Quartz palette for warm parchment/terracotta/moss in light mode and mossy-charcoal/cream in dark mode, picked to harmonize with the castle logo. Replace icon.png and og-image.png with the castle artwork (favicon + social previews). Extend PageTitle to render the logo next to the site title in the sidebar via flex layout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { joinSegments, pathToRoot } from "../util/path"
|
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
import { classNames } from "../util/lang"
|
|
import { i18n } from "../i18n"
|
|
|
|
const PageTitle: QuartzComponent = ({ fileData, cfg, displayClass }: QuartzComponentProps) => {
|
|
const title = cfg?.pageTitle ?? i18n(cfg.locale).propertyDefaults.title
|
|
const baseDir = pathToRoot(fileData.slug!)
|
|
const logoPath = joinSegments(baseDir, "static/icon.png")
|
|
return (
|
|
<h2 class={classNames(displayClass, "page-title")}>
|
|
<a href={baseDir} class="page-title-link">
|
|
<img src={logoPath} alt="" class="page-title-logo" />
|
|
<span class="page-title-text">{title}</span>
|
|
</a>
|
|
</h2>
|
|
)
|
|
}
|
|
|
|
PageTitle.css = `
|
|
.page-title {
|
|
font-size: 1.75rem;
|
|
margin: 0;
|
|
font-family: var(--titleFont);
|
|
}
|
|
.page-title-link {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.6rem;
|
|
text-decoration: none;
|
|
}
|
|
.page-title-logo {
|
|
width: 2.4rem;
|
|
height: 2.4rem;
|
|
flex-shrink: 0;
|
|
object-fit: contain;
|
|
}
|
|
.page-title-text {
|
|
line-height: 1.1;
|
|
}
|
|
`
|
|
|
|
export default (() => PageTitle) satisfies QuartzComponentConstructor
|