mirror of
https://github.com/ZetaKebab/quartz.git
synced 2025-06-22 00:34:37 +00:00
Merge branch 'v4' into jpg
This commit is contained in:
@ -2,10 +2,15 @@ import { i18n } from "../../i18n"
|
||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
|
||||
|
||||
const NotFound: QuartzComponent = ({ cfg }: QuartzComponentProps) => {
|
||||
// If baseUrl contains a pathname after the domain, use this as the home link
|
||||
const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`)
|
||||
const baseDir = url.pathname
|
||||
|
||||
return (
|
||||
<article class="popover-hint">
|
||||
<h1>404</h1>
|
||||
<p>{i18n(cfg.locale).pages.error.notFound}</p>
|
||||
<a href={baseDir}>{i18n(cfg.locale).pages.error.home}</a>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
@ -223,6 +223,18 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
||||
.transition()
|
||||
.duration(200)
|
||||
.style("opacity", 0.2)
|
||||
|
||||
d3.selectAll<HTMLElement, NodeData>(".node")
|
||||
.filter((d) => !connectedNodes.includes(d.id))
|
||||
.nodes()
|
||||
.map((it) => d3.select(it.parentNode as HTMLElement).select("text"))
|
||||
.forEach((it) => {
|
||||
let opacity = parseFloat(it.style("opacity"))
|
||||
it.transition()
|
||||
.duration(200)
|
||||
.attr("opacityOld", opacity)
|
||||
.style("opacity", Math.min(opacity, 0.2))
|
||||
})
|
||||
}
|
||||
|
||||
// highlight links
|
||||
@ -245,6 +257,12 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
||||
if (focusOnHover) {
|
||||
d3.selectAll<HTMLElement, NodeData>(".link").transition().duration(200).style("opacity", 1)
|
||||
d3.selectAll<HTMLElement, NodeData>(".node").transition().duration(200).style("opacity", 1)
|
||||
|
||||
d3.selectAll<HTMLElement, NodeData>(".node")
|
||||
.filter((d) => !connectedNodes.includes(d.id))
|
||||
.nodes()
|
||||
.map((it) => d3.select(it.parentNode as HTMLElement).select("text"))
|
||||
.forEach((it) => it.transition().duration(200).style("opacity", it.attr("opacityOld")))
|
||||
}
|
||||
const currentId = d.id
|
||||
const linkNodes = d3
|
||||
@ -264,6 +282,13 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
|
||||
// @ts-ignore
|
||||
.call(drag(simulation))
|
||||
|
||||
// make tags hollow circles
|
||||
node
|
||||
.filter((d) => d.id.startsWith("tags/"))
|
||||
.attr("stroke", color)
|
||||
.attr("stroke-width", 2)
|
||||
.attr("fill", "var(--light)")
|
||||
|
||||
// draw labels
|
||||
const labels = graphNode
|
||||
.append("text")
|
||||
|
@ -70,6 +70,7 @@ export default {
|
||||
error: {
|
||||
title: "غير موجود",
|
||||
notFound: "إما أن هذه الصفحة خاصة أو غير موجودة.",
|
||||
home: "العوده للصفحة الرئيسية",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "مجلد",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Nicht gefunden",
|
||||
notFound: "Diese Seite ist entweder nicht öffentlich oder existiert nicht.",
|
||||
home: "Return to Homepage",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Ordner",
|
||||
|
@ -67,6 +67,7 @@ export interface Translation {
|
||||
error: {
|
||||
title: string
|
||||
notFound: string
|
||||
home: string
|
||||
}
|
||||
folderContent: {
|
||||
folder: string
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Not Found",
|
||||
notFound: "Either this page is private or doesn't exist.",
|
||||
home: "Return to Homepage",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Folder",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "No se encontró.",
|
||||
notFound: "Esta página es privada o no existe.",
|
||||
home: "Regresar a la página principal",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Carpeta",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "یافت نشد",
|
||||
notFound: "این صفحه یا خصوصی است یا وجود ندارد",
|
||||
home: "بازگشت به صفحه اصلی",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "پوشه",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Introuvable",
|
||||
notFound: "Cette page est soit privée, soit elle n'existe pas.",
|
||||
home: "Retour à la page d'accueil",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Dossier",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Nem található",
|
||||
notFound: "Ez a lap vagy privát vagy nem létezik.",
|
||||
home: "Vissza a kezdőlapra",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Mappa",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Non trovato",
|
||||
notFound: "Questa pagina è privata o non esiste.",
|
||||
home: "Ritorna alla home page",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Cartella",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Not Found",
|
||||
notFound: "ページが存在しないか、非公開設定になっています。",
|
||||
home: "ホームページに戻る",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "フォルダ",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Not Found",
|
||||
notFound: "페이지가 존재하지 않거나 비공개 설정이 되어 있습니다.",
|
||||
home: "홈페이지로 돌아가기",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "폴더",
|
||||
|
@ -66,6 +66,7 @@ export default {
|
||||
error: {
|
||||
title: "Niet gevonden",
|
||||
notFound: "Deze pagina is niet zichtbaar of bestaat niet.",
|
||||
home: "Keer terug naar de start pagina",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Map",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Nie znaleziono",
|
||||
notFound: "Ta strona jest prywatna lub nie istnieje.",
|
||||
home: "Powrót do strony głównej",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Folder",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Não encontrado",
|
||||
notFound: "Esta página é privada ou não existe.",
|
||||
home: "Retornar a página inicial",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Arquivo",
|
||||
|
@ -66,6 +66,7 @@ export default {
|
||||
error: {
|
||||
title: "Pagina nu a fost găsită",
|
||||
notFound: "Fie această pagină este privată, fie nu există.",
|
||||
home: "Reveniți la pagina de pornire",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Dosar",
|
||||
|
@ -67,6 +67,7 @@ export default {
|
||||
error: {
|
||||
title: "Страница не найдена",
|
||||
notFound: "Эта страница приватная или не существует",
|
||||
home: "Вернуться на главную страницу",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Папка",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Не знайдено",
|
||||
notFound: "Ця сторінка або приватна, або не існує.",
|
||||
home: "Повернутися на головну сторінку",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Папка",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "Không Tìm Thấy",
|
||||
notFound: "Trang này được bảo mật hoặc không tồn tại.",
|
||||
home: "Trở về trang chủ",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "Thư Mục",
|
||||
|
@ -65,6 +65,7 @@ export default {
|
||||
error: {
|
||||
title: "无法找到",
|
||||
notFound: "私有笔记或笔记不存在。",
|
||||
home: "返回首页",
|
||||
},
|
||||
folderContent: {
|
||||
folder: "文件夹",
|
||||
|
@ -123,8 +123,8 @@ export const tableWikilinkRegex = new RegExp(/(!?\[\[[^\]]*?\]\])/, "g")
|
||||
const highlightRegex = new RegExp(/==([^=]+)==/, "g")
|
||||
const commentRegex = new RegExp(/%%[\s\S]*?%%/, "g")
|
||||
// from https://github.com/escwxyz/remark-obsidian-callout/blob/main/src/index.ts
|
||||
const calloutRegex = new RegExp(/^\[\!(\w+)\]([+-]?)/)
|
||||
const calloutLineRegex = new RegExp(/^> *\[\!\w+\][+-]?.*$/, "gm")
|
||||
const calloutRegex = new RegExp(/^\[\!(\w+)\|?(.+?)?\]([+-]?)/)
|
||||
const calloutLineRegex = new RegExp(/^> *\[\!\w+\|?.*?\][+-]?.*$/, "gm")
|
||||
// (?:^| ) -> non-capturing group, tag should start be separated by a space or be the start of the line
|
||||
// #(...) -> capturing group, tag itself must start with #
|
||||
// (?:[-_\p{L}\d\p{Z}])+ -> non-capturing group, non-empty string of (Unicode-aware) alpha-numeric characters and symbols, hyphens and/or underscores
|
||||
@ -427,7 +427,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
||||
|
||||
const match = firstLine.match(calloutRegex)
|
||||
if (match && match.input) {
|
||||
const [calloutDirective, typeString, collapseChar] = match
|
||||
const [calloutDirective, typeString, calloutMetaData, collapseChar] = match
|
||||
const calloutType = canonicalizeCallout(typeString.toLowerCase())
|
||||
const collapse = collapseChar === "+" || collapseChar === "-"
|
||||
const defaultState = collapseChar === "-" ? "collapsed" : "expanded"
|
||||
@ -489,6 +489,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
||||
className: classNames.join(" "),
|
||||
"data-callout": calloutType,
|
||||
"data-callout-fold": collapse,
|
||||
"data-callout-metadata": calloutMetaData,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user