-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquartz.config.tsx
202 lines (199 loc) · 5.17 KB
/
quartz.config.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
import { SatoriOptions } from "satori/wasm"
import { GlobalConfiguration, QuartzConfig } from "./quartz/cfg"
import { QuartzPluginData } from "./quartz/plugins/vfile"
import { SocialImageOptions, UserOpts } from "./quartz/util/og"
import * as Plugin from "./quartz/plugins"
/**
* Quartz 4.0 Configuration
*
* See https://quartz.jzhao.xyz/configuration for more information.
*/
const ogpImageStructure: SocialImageOptions["imageStructure"] = (
cfg: GlobalConfiguration,
{ colorScheme }: UserOpts,
title: string,
description: string,
fonts: SatoriOptions["fonts"],
_fileData: QuartzPluginData,
) => {
// How many characters are allowed before switching to smaller font
const fontBreakPoint = 22
const descFontBreakPoint = 32
const titleSize = title.length > fontBreakPoint ? 50 : 72
const descSize = description.length > descFontBreakPoint ? 32 : 44
// Setup to access image
const iconPath = `https://${cfg.baseUrl}/static/icon.png`
return (
<div
style={{
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
height: "100%",
width: "100%",
backgroundColor: cfg.theme.colors[colorScheme].light,
gap: "2rem",
paddingTop: "1.5rem",
paddingBottom: "1.5rem",
paddingLeft: "5rem",
paddingRight: "5rem",
}}
>
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "flex-start",
width: "100%",
flexDirection: "row",
gap: "2.5rem",
}}
>
<p
style={{
color: cfg.theme.colors[colorScheme].dark,
fontSize: titleSize,
fontFamily: fonts[0].name,
}}
>
{title}
</p>
</div>
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "flex-start",
width: "100%",
flexDirection: "row",
gap: "2.5rem",
}}
>
<p
style={{
color: cfg.theme.colors[colorScheme].dark,
fontSize: descSize,
lineClamp: 3,
fontFamily: fonts[1].name,
}}
>
{description}
</p>
</div>
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "flex-end",
width: "100%",
flexDirection: "row",
gap: "2.5rem",
}}
>
<img src={iconPath} width={50} height={50} />
<p
style={{
color: cfg.theme.colors[colorScheme].dark,
fontSize: 30,
lineClamp: 3,
fontFamily: fonts[1].name,
fontStyle: "italic",
}}
>
Myuu's Trashcan
</p>
</div>
</div>
)
}
const config: QuartzConfig = {
configuration: {
pageTitle: "Myuu's Trashcan",
pageTitleSuffix: "",
enableSPA: true,
enablePopovers: true,
analytics: {
provider: "plausible",
},
locale: "en-US",
baseUrl: "notes.myuu.dev",
ignorePatterns: ["private", "templates", ".obsidian", "_config"],
defaultDateType: "created",
generateSocialImages: {
colorScheme: "darkMode",
imageStructure: ogpImageStructure,
},
theme: {
fontOrigin: "googleFonts",
cdnCaching: true,
typography: {
header: "M PLUS 1p",
body: "IBM Plex Sans JP",
code: "IBM Plex Mono",
},
colors: {
lightMode: {
light: "#f0f8fc",
lightgray: "#e5e5e5",
gray: "#b8b8b8",
darkgray: "#4e4e4e",
dark: "#2b2b2b",
secondary: "#63B3EC",
tertiary: "#a3d2f4",
highlight: "rgba(99, 179, 236, 0.3)",
textHighlight: "#fff23688",
},
darkMode: {
light: "#161618",
lightgray: "#393639",
gray: "#646464",
darkgray: "#d4d4d4",
dark: "#ebebec",
secondary: "#D1E9F9",
tertiary: "#a3d2f4",
highlight: "rgba(99, 179, 236, 0.3)",
textHighlight: "#b3aa0288",
},
},
},
},
plugins: {
transformers: [
Plugin.FrontMatter(),
Plugin.CreatedModifiedDate({
priority: ["frontmatter", "filesystem"],
}),
Plugin.SyntaxHighlighting({
theme: {
light: "github-light",
dark: "github-dark",
},
keepBackground: false,
}),
Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: true }),
Plugin.GitHubFlavoredMarkdown(),
Plugin.HardLineBreaks(),
Plugin.TableOfContents(),
Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }),
Plugin.Description(),
Plugin.Latex({ renderEngine: "katex" }),
],
filters: [Plugin.ExplicitPublish()],
emitters: [
Plugin.AliasRedirects(),
Plugin.ComponentResources(),
Plugin.ContentPage(),
Plugin.FolderPage(),
Plugin.TagPage(),
Plugin.ContentIndex({
enableSiteMap: true,
enableRSS: true,
}),
Plugin.Assets(),
Plugin.Static(),
Plugin.NotFoundPage(),
],
},
}
export default config