🔧 settings

This commit is contained in:
jyje 2024-02-18 22:20:15 +09:00
parent ea595b21ad
commit 0895e87568
19 changed files with 59 additions and 48 deletions

View File

@ -3,33 +3,33 @@ import * as Plugin from "./quartz/plugins"
const config: QuartzConfig = {
configuration: {
pageTitle: "🪴 Quartz 4.0",
pageTitle: "📜 docs.jyje.online",
enableSPA: true,
enablePopovers: true,
analytics: {
provider: "plausible",
},
locale: "en-US",
baseUrl: "quartz.jzhao.xyz",
baseUrl: "docs.jyje.online",
ignorePatterns: ["private", "templates", ".obsidian"],
defaultDateType: "created",
theme: {
cdnCaching: true,
typography: {
header: "Schibsted Grotesk",
body: "Source Sans Pro",
code: "IBM Plex Mono",
header: "Noto Sans KR", // Schibsted Grotesk
body: "Noto Sans KR", // Source Sans Pro
code: "Noto Sans Mono", // IBM Plex Mono
},
colors: {
lightMode: {
light: "#faf8f8",
light: "#ffffff",
lightgray: "#e5e5e5",
gray: "#b8b8b8",
darkgray: "#4e4e4e",
dark: "#2b2b2b",
secondary: "#284b63",
tertiary: "#84a59d",
highlight: "rgba(143, 159, 169, 0.15)",
secondary: "#680c2c",
tertiary: "#da185c",
highlight: "rgba(104, 12, 44, 0.15)",
},
darkMode: {
light: "#161618",
@ -37,9 +37,9 @@ const config: QuartzConfig = {
gray: "#646464",
darkgray: "#d4d4d4",
dark: "#ebebec",
secondary: "#7b97aa",
tertiary: "#84a59d",
highlight: "rgba(143, 159, 169, 0.15)",
secondary: "#f2bac2",
tertiary: "#da185c",
highlight: "rgba(180, 20, 76, 0.15)",
},
},
},

View File

@ -7,8 +7,11 @@ export const sharedPageComponents: SharedLayout = {
header: [],
footer: Component.Footer({
links: {
GitHub: "https://github.com/jackyzha0/quartz",
"Discord Community": "https://discord.gg/cRFFHYye7t",
Repository: "https://github.com/jyje/docs",
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",
},
}),
}

View File

@ -9,14 +9,30 @@ interface Options {
export default ((opts?: Options) => {
const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
const beginYear = 2022
const year = new Date().getFullYear()
const links = opts?.links ?? []
return (
<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 />
<p>
{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>
<ul>
{Object.entries(links).map(([text, link]) => (

View File

@ -27,6 +27,7 @@ export default (() => {
<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 property="og:title" content={title} />
<meta property="og:description" content={description} />

View File

@ -37,47 +37,29 @@ async function mouseEnterHandler(
targetUrl.hash = ""
targetUrl.search = ""
const response = await fetch(`${targetUrl}`).catch((err) => {
console.error(err)
})
const contents = await fetch(`${targetUrl}`)
.then((res) => res.text())
.catch((err) => {
console.error(err)
})
// bailout if another popover exists
if (hasAlreadyBeenFetched()) {
return
}
if (!response) return
const contentType = response.headers.get("Content-Type")
const contentTypeCategory = contentType?.split("/")[0] ?? "text"
if (!contents) return
const html = p.parseFromString(contents, "text/html")
normalizeRelativeURLs(html, targetUrl)
const elts = [...html.getElementsByClassName("popover-hint")]
if (elts.length === 0) return
const popoverElement = document.createElement("div")
popoverElement.classList.add("popover")
const popoverInner = document.createElement("div")
popoverInner.classList.add("popover-inner")
popoverElement.appendChild(popoverInner)
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))
}
elts.forEach((elt) => popoverInner.appendChild(elt))
setPosition(popoverElement)
link.appendChild(popoverElement)

View File

@ -87,7 +87,7 @@ svg {
color: var(--secondary);
font-family: var(--headerFont);
font-size: 0.95rem;
font-weight: $semiBoldWeight;
font-weight: $boldWeight;
line-height: 1.5rem;
display: inline-block;
}
@ -112,7 +112,7 @@ svg {
font-size: 0.95rem;
display: inline-block;
color: var(--secondary);
font-weight: $semiBoldWeight;
font-weight: $boldWeight;
margin: 0;
line-height: 1.5rem;
pointer-events: none;

View File

@ -1,7 +1,7 @@
footer {
text-align: left;
margin-bottom: 4rem;
opacity: 0.7;
opacity: 0.9;
& ul {
list-style: none;

View File

@ -1,7 +1,7 @@
.recent-notes {
& > h3 {
margin: 0.5rem 0 0 0;
font-size: 1rem;
margin: 0;
}
& > ul.recent-ul {

View File

@ -33,6 +33,7 @@ export default {
title: "Explorer",
},
footer: {
poweredBy: "Powered by",
createdWith: "Erstellt mit",
},
graph: {

View File

@ -35,6 +35,7 @@ export interface Translation {
title: string
}
footer: {
poweredBy: string
createdWith: string
}
graph: {

View File

@ -33,6 +33,7 @@ export default {
title: "Explorer",
},
footer: {
poweredBy: "Powered by",
createdWith: "Created with",
},
graph: {

View File

@ -33,6 +33,7 @@ export default {
title: "Explorador",
},
footer: {
poweredBy: "Powered by",
createdWith: "Creado con",
},
graph: {

View File

@ -33,6 +33,7 @@ export default {
title: "Explorateur",
},
footer: {
poweredBy: "Powered by",
createdWith: "Créé avec",
},
graph: {

View File

@ -33,6 +33,7 @@ export default {
title: "エクスプローラー",
},
footer: {
poweredBy: "Powered by",
createdWith: "作成",
},
graph: {

View File

@ -33,6 +33,7 @@ export default {
title: "Verkenner",
},
footer: {
poweredBy: "Powered by",
createdWith: "Gemaakt met",
},
graph: {

View File

@ -33,6 +33,7 @@ export default {
title: "Explorator",
},
footer: {
poweredBy: "Powered by",
createdWith: "Creat cu",
},
graph: {

View File

@ -33,6 +33,7 @@ export default {
title: "Провідник",
},
footer: {
poweredBy: "Powered by",
createdWith: "Створено за допомогою",
},
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