{folderBehavior === "link" ? (
-
+
{node.displayName}
) : (
diff --git a/quartz/components/scripts/graph.inline.ts b/quartz/components/scripts/graph.inline.ts
index 15a9a061c..1a4140b48 100644
--- a/quartz/components/scripts/graph.inline.ts
+++ b/quartz/components/scripts/graph.inline.ts
@@ -361,7 +361,7 @@ function renderGlobalGraph() {
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
const slug = e.detail.url
- addToVisited(slug)
+ addToVisited(simplifySlug(slug))
await renderGraph("graph-container", slug)
const containerIcon = document.getElementById("global-graph-icon")
diff --git a/quartz/components/scripts/popover.inline.ts b/quartz/components/scripts/popover.inline.ts
index 972d3c638..49f438205 100644
--- a/quartz/components/scripts/popover.inline.ts
+++ b/quartz/components/scripts/popover.inline.ts
@@ -3,7 +3,7 @@ import { normalizeRelativeURLs } from "../../util/path"
const p = new DOMParser()
async function mouseEnterHandler(
- this: HTMLLinkElement,
+ this: HTMLAnchorElement,
{ clientX, clientY }: { clientX: number; clientY: number },
) {
const link = this
@@ -33,7 +33,7 @@ async function mouseEnterHandler(
thisUrl.hash = ""
thisUrl.search = ""
const targetUrl = new URL(link.href)
- const hash = targetUrl.hash
+ const hash = decodeURIComponent(targetUrl.hash)
targetUrl.hash = ""
targetUrl.search = ""
@@ -100,7 +100,7 @@ async function mouseEnterHandler(
}
document.addEventListener("nav", () => {
- const links = [...document.getElementsByClassName("internal")] as HTMLLinkElement[]
+ const links = [...document.getElementsByClassName("internal")] as HTMLAnchorElement[]
for (const link of links) {
link.addEventListener("mouseenter", mouseEnterHandler)
window.addCleanup(() => link.removeEventListener("mouseenter", mouseEnterHandler))
diff --git a/quartz/components/styles/listPage.scss b/quartz/components/styles/listPage.scss
index c8fc9e957..d51568dc0 100644
--- a/quartz/components/styles/listPage.scss
+++ b/quartz/components/styles/listPage.scss
@@ -11,7 +11,7 @@ li.section-li {
& > .section {
display: grid;
- grid-template-columns: 6em 3fr 1fr;
+ grid-template-columns: fit-content(8em) 3fr 1fr;
@media all and (max-width: $mobileBreakpoint) {
& > .tags {
@@ -24,8 +24,7 @@ li.section-li {
}
& > .meta {
- margin: 0;
- flex-basis: 6em;
+ margin: 0 1em 0 0;
opacity: 0.6;
}
}
@@ -33,7 +32,8 @@ li.section-li {
// modifications in popover context
.popover .section {
- grid-template-columns: 6em 1fr !important;
+ grid-template-columns: fit-content(8em) 1fr !important;
+
& > .tags {
display: none;
}
diff --git a/quartz/i18n/index.ts b/quartz/i18n/index.ts
index eab1f1a78..5ab52b83e 100644
--- a/quartz/i18n/index.ts
+++ b/quartz/i18n/index.ts
@@ -6,6 +6,7 @@ import ja from "./locales/ja-JP"
import de from "./locales/de-DE"
import nl from "./locales/nl-NL"
import ro from "./locales/ro-RO"
+import ca from "./locales/ca-ES"
import es from "./locales/es-ES"
import ar from "./locales/ar-SA"
import uk from "./locales/uk-UA"
@@ -20,6 +21,7 @@ import pl from "./locales/pl-PL"
export const TRANSLATIONS = {
"en-US": en,
+ "en-GB": en,
"fr-FR": fr,
"it-IT": it,
"ja-JP": ja,
@@ -28,6 +30,7 @@ export const TRANSLATIONS = {
"nl-BE": nl,
"ro-RO": ro,
"ro-MD": ro,
+ "ca-ES": ca,
"es-ES": es,
"ar-SA": ar,
"ar-AE": ar,
diff --git a/quartz/i18n/locales/ca-ES.ts b/quartz/i18n/locales/ca-ES.ts
new file mode 100644
index 000000000..aadbd4157
--- /dev/null
+++ b/quartz/i18n/locales/ca-ES.ts
@@ -0,0 +1,84 @@
+import { Translation } from "./definition"
+
+export default {
+ propertyDefaults: {
+ title: "Sense títol",
+ description: "Sense descripció",
+ },
+ components: {
+ callout: {
+ note: "Nota",
+ abstract: "Resum",
+ info: "Informació",
+ todo: "Per fer",
+ tip: "Consell",
+ success: "Èxit",
+ question: "Pregunta",
+ warning: "Advertència",
+ failure: "Fall",
+ danger: "Perill",
+ bug: "Error",
+ example: "Exemple",
+ quote: "Cita",
+ },
+ backlinks: {
+ title: "Retroenllaç",
+ noBacklinksFound: "No s'han trobat retroenllaços",
+ },
+ themeToggle: {
+ lightMode: "Mode clar",
+ darkMode: "Mode fosc",
+ },
+ explorer: {
+ title: "Explorador",
+ },
+ footer: {
+ createdWith: "Creat amb",
+ },
+ graph: {
+ title: "Vista Gràfica",
+ },
+ recentNotes: {
+ title: "Notes Recents",
+ seeRemainingMore: ({ remaining }) => `Vegi ${remaining} més →`,
+ },
+ transcludes: {
+ transcludeOf: ({ targetSlug }) => `Transcluit de ${targetSlug}`,
+ linkToOriginal: "Enllaç a l'original",
+ },
+ search: {
+ title: "Cercar",
+ searchBarPlaceholder: "Cerca alguna cosa",
+ },
+ tableOfContents: {
+ title: "Taula de Continguts",
+ },
+ contentMeta: {
+ readingTime: ({ minutes }) => `Es llegeix en ${minutes} min`,
+ },
+ },
+ pages: {
+ rss: {
+ recentNotes: "Notes recents",
+ lastFewNotes: ({ count }) => `Últimes ${count} notes`,
+ },
+ error: {
+ title: "No s'ha trobat.",
+ notFound: "Aquesta pàgina és privada o no existeix.",
+ home: "Torna a la pàgina principal",
+ },
+ folderContent: {
+ folder: "Carpeta",
+ itemsUnderFolder: ({ count }) =>
+ count === 1 ? "1 article en aquesta carpeta." : `${count} articles en esta carpeta.`,
+ },
+ tagContent: {
+ tag: "Etiqueta",
+ tagIndex: "índex d'Etiquetes",
+ itemsUnderTag: ({ count }) =>
+ count === 1 ? "1 article amb aquesta etiqueta." : `${count} article amb aquesta etiqueta.`,
+ showingFirst: ({ count }) => `Mostrant les primeres ${count} etiquetes.`,
+ totalTags: ({ count }) => `S'han trobat ${count} etiquetes en total.`,
+ },
+ },
+} as const satisfies Translation
diff --git a/quartz/i18n/locales/en-GB.ts b/quartz/i18n/locales/en-GB.ts
new file mode 100644
index 000000000..5388b032c
--- /dev/null
+++ b/quartz/i18n/locales/en-GB.ts
@@ -0,0 +1,84 @@
+import { Translation } from "./definition"
+
+export default {
+ propertyDefaults: {
+ title: "Untitled",
+ description: "No description provided",
+ },
+ components: {
+ callout: {
+ note: "Note",
+ abstract: "Abstract",
+ info: "Info",
+ todo: "To-Do",
+ tip: "Tip",
+ success: "Success",
+ question: "Question",
+ warning: "Warning",
+ failure: "Failure",
+ danger: "Danger",
+ bug: "Bug",
+ example: "Example",
+ quote: "Quote",
+ },
+ backlinks: {
+ title: "Backlinks",
+ noBacklinksFound: "No backlinks found",
+ },
+ themeToggle: {
+ lightMode: "Light mode",
+ darkMode: "Dark mode",
+ },
+ explorer: {
+ title: "Explorer",
+ },
+ footer: {
+ createdWith: "Created with",
+ },
+ graph: {
+ title: "Graph View",
+ },
+ recentNotes: {
+ title: "Recent Notes",
+ seeRemainingMore: ({ remaining }) => `See ${remaining} more →`,
+ },
+ transcludes: {
+ transcludeOf: ({ targetSlug }) => `Transclude of ${targetSlug}`,
+ linkToOriginal: "Link to original",
+ },
+ search: {
+ title: "Search",
+ searchBarPlaceholder: "Search for something",
+ },
+ tableOfContents: {
+ title: "Table of Contents",
+ },
+ contentMeta: {
+ readingTime: ({ minutes }) => `${minutes} min read`,
+ },
+ },
+ pages: {
+ rss: {
+ recentNotes: "Recent notes",
+ lastFewNotes: ({ count }) => `Last ${count} notes`,
+ },
+ error: {
+ title: "Not Found",
+ notFound: "Either this page is private or doesn't exist.",
+ home: "Return to Homepage",
+ },
+ folderContent: {
+ folder: "Folder",
+ itemsUnderFolder: ({ count }) =>
+ count === 1 ? "1 item under this folder." : `${count} items under this folder.`,
+ },
+ tagContent: {
+ tag: "Tag",
+ tagIndex: "Tag Index",
+ itemsUnderTag: ({ count }) =>
+ count === 1 ? "1 item with this tag." : `${count} items with this tag.`,
+ showingFirst: ({ count }) => `Showing first ${count} tags.`,
+ totalTags: ({ count }) => `Found ${count} total tags.`,
+ },
+ },
+} as const satisfies Translation
diff --git a/quartz/i18n/locales/es-ES.ts b/quartz/i18n/locales/es-ES.ts
index 8b0adcc37..c4a57aa12 100644
--- a/quartz/i18n/locales/es-ES.ts
+++ b/quartz/i18n/locales/es-ES.ts
@@ -22,8 +22,8 @@ export default {
quote: "Cita",
},
backlinks: {
- title: "Enlaces de Retroceso",
- noBacklinksFound: "No se han encontrado enlaces traseros",
+ title: "Retroenlaces",
+ noBacklinksFound: "No se han encontrado retroenlaces",
},
themeToggle: {
lightMode: "Modo claro",
@@ -54,18 +54,18 @@ export default {
title: "Tabla de Contenidos",
},
contentMeta: {
- readingTime: ({ minutes }) => `${minutes} min read`,
+ readingTime: ({ minutes }) => `Se lee en ${minutes} min`,
},
},
pages: {
rss: {
recentNotes: "Notas recientes",
- lastFewNotes: ({ count }) => `Últimás ${count} notas`,
+ lastFewNotes: ({ count }) => `Últimas ${count} notas`,
},
error: {
- title: "No se encontró.",
+ title: "No se ha encontrado.",
notFound: "Esta página es privada o no existe.",
- home: "Regresar a la página principal",
+ home: "Regresa a la página principal",
},
folderContent: {
folder: "Carpeta",
@@ -78,7 +78,7 @@ export default {
itemsUnderTag: ({ count }) =>
count === 1 ? "1 artículo con esta etiqueta." : `${count} artículos con esta etiqueta.`,
showingFirst: ({ count }) => `Mostrando las primeras ${count} etiquetas.`,
- totalTags: ({ count }) => `Se encontraron ${count} etiquetas en total.`,
+ totalTags: ({ count }) => `Se han encontrado ${count} etiquetas en total.`,
},
},
} as const satisfies Translation
diff --git a/quartz/i18n/locales/uk-UA.ts b/quartz/i18n/locales/uk-UA.ts
index d39febb75..469de4f80 100644
--- a/quartz/i18n/locales/uk-UA.ts
+++ b/quartz/i18n/locales/uk-UA.ts
@@ -54,7 +54,7 @@ export default {
title: "Зміст",
},
contentMeta: {
- readingTime: ({ minutes }) => `${minutes} min read`,
+ readingTime: ({ minutes }) => `${minutes} хв читання`,
},
},
pages: {
@@ -68,17 +68,17 @@ export default {
home: "Повернутися на головну сторінку",
},
folderContent: {
- folder: "Папка",
+ folder: "Тека",
itemsUnderFolder: ({ count }) =>
- count === 1 ? "У цій папці 1 елемент." : `Елементів у цій папці: ${count}.`,
+ count === 1 ? "У цій теці 1 елемент." : `Елементів у цій теці: ${count}.`,
},
tagContent: {
- tag: "Тег",
- tagIndex: "Індекс тегу",
+ tag: "Мітка",
+ tagIndex: "Індекс мітки",
itemsUnderTag: ({ count }) =>
- count === 1 ? "1 елемент з цим тегом." : `Елементів з цим тегом: ${count}.`,
- showingFirst: ({ count }) => `Показ перших ${count} тегів.`,
- totalTags: ({ count }) => `Всього знайдено тегів: ${count}.`,
+ count === 1 ? "1 елемент з цією міткою." : `Елементів з цією міткою: ${count}.`,
+ showingFirst: ({ count }) => `Показ перших ${count} міток.`,
+ totalTags: ({ count }) => `Всього знайдено міток: ${count}.`,
},
},
} as const satisfies Translation
diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts
index e6725d99d..d1d8c8597 100644
--- a/quartz/plugins/emitters/componentResources.ts
+++ b/quartz/plugins/emitters/componentResources.ts
@@ -144,6 +144,14 @@ function addGlobalPageResources(ctx: BuildCtx, componentResources: ComponentReso
tinylyticsScript.defer = true
document.head.appendChild(tinylyticsScript)
`)
+ } else if (cfg.analytics?.provider === "cabin") {
+ componentResources.afterDOMLoaded.push(`
+ const cabinScript = document.createElement("script")
+ cabinScript.src = "${cfg.analytics.host ?? "https://scripts.cabin.dev"}/cabin.js"
+ cabinScript.defer = true
+ cabinScript.async = true
+ document.head.appendChild(cabinScript)
+ `)
}
if (cfg.enableSPA) {
diff --git a/quartz/plugins/filters/draft.ts b/quartz/plugins/filters/draft.ts
index 65e2d6b61..5fd06b965 100644
--- a/quartz/plugins/filters/draft.ts
+++ b/quartz/plugins/filters/draft.ts
@@ -3,7 +3,7 @@ import { QuartzFilterPlugin } from "../types"
export const RemoveDrafts: QuartzFilterPlugin<{}> = () => ({
name: "RemoveDrafts",
shouldPublish(_ctx, [_tree, vfile]) {
- const draftFlag: boolean = vfile.data?.frontmatter?.draft ?? false
+ const draftFlag: boolean = vfile.data?.frontmatter?.draft || false
return !draftFlag
},
})
diff --git a/quartz/plugins/transformers/links.ts b/quartz/plugins/transformers/links.ts
index f89d367d7..280581828 100644
--- a/quartz/plugins/transformers/links.ts
+++ b/quartz/plugins/transformers/links.ts
@@ -93,7 +93,7 @@ export const CrawlLinks: QuartzTransformerPlugin
| undefined> =
}
node.properties.className = classes
- if (opts.openLinksInNewTab) {
+ if (isExternal && opts.openLinksInNewTab) {
node.properties.target = "_blank"
}
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 414d8f65c..925d21e0d 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -6,6 +6,7 @@ import { slug as slugAnchor } from "github-slugger"
import rehypeRaw from "rehype-raw"
import { SKIP, visit } from "unist-util-visit"
import path from "path"
+import { splitAnchor } from "../../util/path"
import { JSResource } from "../../util/resources"
// @ts-ignore
import calloutScript from "../../components/scripts/callout.inline.ts"
@@ -199,10 +200,9 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin
src = src.replace(wikilinkRegex, (value, ...capture) => {
const [rawFp, rawHeader, rawAlias]: (string | undefined)[] = capture
- const fp = rawFp ?? ""
- const anchor = rawHeader?.trim().replace(/^#+/, "")
+ const [fp, anchor] = splitAnchor(`${rawFp ?? ""}${rawHeader ?? ""}`)
const blockRef = Boolean(anchor?.startsWith("^")) ? "^" : ""
- const displayAnchor = anchor ? `#${blockRef}${slugAnchor(anchor)}` : ""
+ const displayAnchor = anchor ? `#${blockRef}${anchor.trim().replace(/^#+/, "")}` : ""
const displayAlias = rawAlias ?? rawHeader?.replace("#", "|") ?? ""
const embedDisplay = value.startsWith("!") ? "!" : ""
@@ -414,8 +414,8 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin
return
}
- // find first line
- const firstChild = node.children[0]
+ // find first line and callout content
+ const [firstChild, ...calloutContent] = node.children
if (firstChild.type !== "paragraph" || firstChild.children[0]?.type !== "text") {
return
}
@@ -492,6 +492,21 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin
"data-callout-metadata": calloutMetaData,
},
}
+
+ // Add callout-content class to callout body if it has one.
+ if (calloutContent.length > 0) {
+ const contentData: BlockContent | DefinitionContent = {
+ data: {
+ hProperties: {
+ className: "callout-content",
+ },
+ hName: "div",
+ },
+ type: "blockquote",
+ children: [...calloutContent],
+ }
+ node.children = [node.children[0], contentData]
+ }
}
})
}
diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss
index 859bb433e..37aa8ce0b 100644
--- a/quartz/styles/base.scss
+++ b/quartz/styles/base.scss
@@ -43,10 +43,22 @@ ul,
.math {
color: var(--darkgray);
fill: var(--darkgray);
- overflow-wrap: anywhere;
hyphens: auto;
}
+p,
+ul,
+text,
+a,
+li,
+ol,
+ul,
+.katex,
+.math {
+ overflow-wrap: anywhere;
+ /* tr and td removed from list of selectors for overflow-wrap, allowing them to use default 'normal' property value */
+}
+
.math {
&.math-display {
text-align: center;
@@ -481,6 +493,10 @@ video {
flex: 1 1 auto;
}
+div:has(> .overflow) {
+ position: relative;
+}
+
ul.overflow,
ol.overflow {
max-height: 400;
diff --git a/quartz/styles/callouts.scss b/quartz/styles/callouts.scss
index b1fd180ce..d6f65aadc 100644
--- a/quartz/styles/callouts.scss
+++ b/quartz/styles/callouts.scss
@@ -10,7 +10,7 @@
transition: max-height 0.3s ease;
box-sizing: border-box;
- & > *:nth-child(2) {
+ & > .callout-content > :first-child {
margin-top: 0;
}
diff --git a/tsconfig.json b/tsconfig.json
index 306204b5d..784ab231b 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -13,8 +13,8 @@
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"jsx": "react-jsx",
- "jsxImportSource": "preact",
+ "jsxImportSource": "preact"
},
"include": ["**/*.ts", "**/*.tsx", "./package.json"],
- "exclude": ["build/**/*.d.ts"],
+ "exclude": ["build/**/*.d.ts"]
}