mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-30 16:24:06 -06:00
🔧 settings
This commit is contained in:
parent
ea595b21ad
commit
0895e87568
@ -3,33 +3,33 @@ import * as Plugin from "./quartz/plugins"
|
|||||||
|
|
||||||
const config: QuartzConfig = {
|
const config: QuartzConfig = {
|
||||||
configuration: {
|
configuration: {
|
||||||
pageTitle: "🪴 Quartz 4.0",
|
pageTitle: "📜 docs.jyje.online",
|
||||||
enableSPA: true,
|
enableSPA: true,
|
||||||
enablePopovers: true,
|
enablePopovers: true,
|
||||||
analytics: {
|
analytics: {
|
||||||
provider: "plausible",
|
provider: "plausible",
|
||||||
},
|
},
|
||||||
locale: "en-US",
|
locale: "en-US",
|
||||||
baseUrl: "quartz.jzhao.xyz",
|
baseUrl: "docs.jyje.online",
|
||||||
ignorePatterns: ["private", "templates", ".obsidian"],
|
ignorePatterns: ["private", "templates", ".obsidian"],
|
||||||
defaultDateType: "created",
|
defaultDateType: "created",
|
||||||
theme: {
|
theme: {
|
||||||
cdnCaching: true,
|
cdnCaching: true,
|
||||||
typography: {
|
typography: {
|
||||||
header: "Schibsted Grotesk",
|
header: "Noto Sans KR", // Schibsted Grotesk
|
||||||
body: "Source Sans Pro",
|
body: "Noto Sans KR", // Source Sans Pro
|
||||||
code: "IBM Plex Mono",
|
code: "Noto Sans Mono", // IBM Plex Mono
|
||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
lightMode: {
|
lightMode: {
|
||||||
light: "#faf8f8",
|
light: "#ffffff",
|
||||||
lightgray: "#e5e5e5",
|
lightgray: "#e5e5e5",
|
||||||
gray: "#b8b8b8",
|
gray: "#b8b8b8",
|
||||||
darkgray: "#4e4e4e",
|
darkgray: "#4e4e4e",
|
||||||
dark: "#2b2b2b",
|
dark: "#2b2b2b",
|
||||||
secondary: "#284b63",
|
secondary: "#680c2c",
|
||||||
tertiary: "#84a59d",
|
tertiary: "#da185c",
|
||||||
highlight: "rgba(143, 159, 169, 0.15)",
|
highlight: "rgba(104, 12, 44, 0.15)",
|
||||||
},
|
},
|
||||||
darkMode: {
|
darkMode: {
|
||||||
light: "#161618",
|
light: "#161618",
|
||||||
@ -37,9 +37,9 @@ const config: QuartzConfig = {
|
|||||||
gray: "#646464",
|
gray: "#646464",
|
||||||
darkgray: "#d4d4d4",
|
darkgray: "#d4d4d4",
|
||||||
dark: "#ebebec",
|
dark: "#ebebec",
|
||||||
secondary: "#7b97aa",
|
secondary: "#f2bac2",
|
||||||
tertiary: "#84a59d",
|
tertiary: "#da185c",
|
||||||
highlight: "rgba(143, 159, 169, 0.15)",
|
highlight: "rgba(180, 20, 76, 0.15)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -7,8 +7,11 @@ export const sharedPageComponents: SharedLayout = {
|
|||||||
header: [],
|
header: [],
|
||||||
footer: Component.Footer({
|
footer: Component.Footer({
|
||||||
links: {
|
links: {
|
||||||
GitHub: "https://github.com/jackyzha0/quartz",
|
Repository: "https://github.com/jyje/docs",
|
||||||
"Discord Community": "https://discord.gg/cRFFHYye7t",
|
License: "https://github.com/jyje/docs/blob/main/LICENSE.txt",
|
||||||
|
Bio: "https://jyje.online",
|
||||||
|
LinkedIn: "https://www.linkedin.com/in/jyje",
|
||||||
|
GitHub: "https://github.com/jyje",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,14 +9,30 @@ interface Options {
|
|||||||
|
|
||||||
export default ((opts?: Options) => {
|
export default ((opts?: Options) => {
|
||||||
const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
|
const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
|
||||||
|
const beginYear = 2022
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const links = opts?.links ?? []
|
const links = opts?.links ?? []
|
||||||
return (
|
return (
|
||||||
<footer class={`${displayClass ?? ""}`}>
|
<footer class={`${displayClass ?? ""}`}>
|
||||||
|
<hr />
|
||||||
|
<script src="https://utteranc.es/client.js"
|
||||||
|
repo="jyje/docs"
|
||||||
|
issue-term="url"
|
||||||
|
label="💬 comment"
|
||||||
|
theme="github-light"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
<hr />
|
<hr />
|
||||||
<p>
|
<p>
|
||||||
{i18n(cfg.locale).components.footer.createdWith}{" "}
|
{i18n(cfg.locale).components.footer.createdWith}{" "}
|
||||||
<a href="https://quartz.jzhao.xyz/">Quartz v{version}</a> © {year}
|
<a href="https://jyje.online">jyje.online</a>
|
||||||
|
{" "}©{" "}{beginYear}-{year}.{" "}
|
||||||
|
{i18n(cfg.locale).components.footer.poweredBy}{" "}
|
||||||
|
<a href="https://quartz.jzhao.xyz">Quartz v{version}</a>
|
||||||
|
{" "}and{" "}
|
||||||
|
<a href="https://pages.github.com">GitHub Pages</a>
|
||||||
|
{" "}with ♥️.
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
{Object.entries(links).map(([text, link]) => (
|
{Object.entries(links).map(([text, link]) => (
|
||||||
|
|||||||
@ -27,6 +27,7 @@ export default (() => {
|
|||||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
<meta name="naver-site-verification" content="7e7588d7de984f2fb2f623e7b666cc6a8548f54b" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta property="og:title" content={title} />
|
<meta property="og:title" content={title} />
|
||||||
<meta property="og:description" content={description} />
|
<meta property="og:description" content={description} />
|
||||||
|
|||||||
@ -37,47 +37,29 @@ async function mouseEnterHandler(
|
|||||||
targetUrl.hash = ""
|
targetUrl.hash = ""
|
||||||
targetUrl.search = ""
|
targetUrl.search = ""
|
||||||
|
|
||||||
const response = await fetch(`${targetUrl}`).catch((err) => {
|
const contents = await fetch(`${targetUrl}`)
|
||||||
console.error(err)
|
.then((res) => res.text())
|
||||||
})
|
.catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
|
|
||||||
// bailout if another popover exists
|
// bailout if another popover exists
|
||||||
if (hasAlreadyBeenFetched()) {
|
if (hasAlreadyBeenFetched()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!response) return
|
if (!contents) return
|
||||||
const contentType = response.headers.get("Content-Type")
|
const html = p.parseFromString(contents, "text/html")
|
||||||
const contentTypeCategory = contentType?.split("/")[0] ?? "text"
|
normalizeRelativeURLs(html, targetUrl)
|
||||||
|
const elts = [...html.getElementsByClassName("popover-hint")]
|
||||||
|
if (elts.length === 0) return
|
||||||
|
|
||||||
const popoverElement = document.createElement("div")
|
const popoverElement = document.createElement("div")
|
||||||
popoverElement.classList.add("popover")
|
popoverElement.classList.add("popover")
|
||||||
const popoverInner = document.createElement("div")
|
const popoverInner = document.createElement("div")
|
||||||
popoverInner.classList.add("popover-inner")
|
popoverInner.classList.add("popover-inner")
|
||||||
popoverElement.appendChild(popoverInner)
|
popoverElement.appendChild(popoverInner)
|
||||||
|
elts.forEach((elt) => popoverInner.appendChild(elt))
|
||||||
popoverInner.dataset.contentType = contentTypeCategory
|
|
||||||
|
|
||||||
switch (contentTypeCategory) {
|
|
||||||
case "image":
|
|
||||||
const img = document.createElement("img")
|
|
||||||
|
|
||||||
response.blob().then((blob) => {
|
|
||||||
img.src = URL.createObjectURL(blob)
|
|
||||||
})
|
|
||||||
img.alt = targetUrl.pathname
|
|
||||||
|
|
||||||
popoverInner.appendChild(img)
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
const contents = await response.text()
|
|
||||||
const html = p.parseFromString(contents, "text/html")
|
|
||||||
normalizeRelativeURLs(html, targetUrl)
|
|
||||||
const elts = [...html.getElementsByClassName("popover-hint")]
|
|
||||||
if (elts.length === 0) return
|
|
||||||
|
|
||||||
elts.forEach((elt) => popoverInner.appendChild(elt))
|
|
||||||
}
|
|
||||||
|
|
||||||
setPosition(popoverElement)
|
setPosition(popoverElement)
|
||||||
link.appendChild(popoverElement)
|
link.appendChild(popoverElement)
|
||||||
|
|||||||
@ -87,7 +87,7 @@ svg {
|
|||||||
color: var(--secondary);
|
color: var(--secondary);
|
||||||
font-family: var(--headerFont);
|
font-family: var(--headerFont);
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
font-weight: $semiBoldWeight;
|
font-weight: $boldWeight;
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ svg {
|
|||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
color: var(--secondary);
|
color: var(--secondary);
|
||||||
font-weight: $semiBoldWeight;
|
font-weight: $boldWeight;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
footer {
|
footer {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-bottom: 4rem;
|
margin-bottom: 4rem;
|
||||||
opacity: 0.7;
|
opacity: 0.9;
|
||||||
|
|
||||||
& ul {
|
& ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
.recent-notes {
|
.recent-notes {
|
||||||
& > h3 {
|
& > h3 {
|
||||||
margin: 0.5rem 0 0 0;
|
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > ul.recent-ul {
|
& > ul.recent-ul {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export default {
|
|||||||
title: "Explorer",
|
title: "Explorer",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: "Powered by",
|
||||||
createdWith: "Erstellt mit",
|
createdWith: "Erstellt mit",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
@ -35,6 +35,7 @@ export interface Translation {
|
|||||||
title: string
|
title: string
|
||||||
}
|
}
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: string
|
||||||
createdWith: string
|
createdWith: string
|
||||||
}
|
}
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export default {
|
|||||||
title: "Explorer",
|
title: "Explorer",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: "Powered by",
|
||||||
createdWith: "Created with",
|
createdWith: "Created with",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export default {
|
|||||||
title: "Explorador",
|
title: "Explorador",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: "Powered by",
|
||||||
createdWith: "Creado con",
|
createdWith: "Creado con",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export default {
|
|||||||
title: "Explorateur",
|
title: "Explorateur",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: "Powered by",
|
||||||
createdWith: "Créé avec",
|
createdWith: "Créé avec",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export default {
|
|||||||
title: "エクスプローラー",
|
title: "エクスプローラー",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: "Powered by",
|
||||||
createdWith: "作成",
|
createdWith: "作成",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export default {
|
|||||||
title: "Verkenner",
|
title: "Verkenner",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: "Powered by",
|
||||||
createdWith: "Gemaakt met",
|
createdWith: "Gemaakt met",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export default {
|
|||||||
title: "Explorator",
|
title: "Explorator",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: "Powered by",
|
||||||
createdWith: "Creat cu",
|
createdWith: "Creat cu",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export default {
|
|||||||
title: "Провідник",
|
title: "Провідник",
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
poweredBy: "Powered by",
|
||||||
createdWith: "Створено за допомогою",
|
createdWith: "Створено за допомогою",
|
||||||
},
|
},
|
||||||
graph: {
|
graph: {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 952 B |
Binary file not shown.
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in New Issue
Block a user