Added a separate title font configuration

This commit is contained in:
Felix Nie 2025-03-17 02:41:18 +08:00
parent 39d4ea1b00
commit c8ae52ee0f
2 changed files with 3 additions and 1 deletions

View File

@ -23,6 +23,7 @@ const config: QuartzConfig = {
fontOrigin: "googleFonts", fontOrigin: "googleFonts",
cdnCaching: true, cdnCaching: true,
typography: { typography: {
title: "Playwrite US Trad",
header: "Schibsted Grotesk", header: "Schibsted Grotesk",
body: "Source Sans Pro", body: "Source Sans Pro",
code: "IBM Plex Mono", code: "IBM Plex Mono",

View File

@ -25,6 +25,7 @@ export type FontSpecification =
export interface Theme { export interface Theme {
typography: { typography: {
title: FontSpecification
header: FontSpecification header: FontSpecification
body: FontSpecification body: FontSpecification
code: FontSpecification code: FontSpecification
@ -48,7 +49,7 @@ export function getFontSpecificationName(spec: FontSpecification): string {
return spec.name return spec.name
} }
function formatFontSpecification(type: "header" | "body" | "code", spec: FontSpecification) { function formatFontSpecification(type: "title" | "header" | "body" | "code", spec: FontSpecification) {
if (typeof spec === "string") { if (typeof spec === "string") {
spec = { name: spec } spec = { name: spec }
} }