From 4fd983277e36e323675e2d77048fb3daaa016dc6 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 2 Apr 2022 17:38:39 -0700 Subject: [PATCH] fix: cjk support + demo page --- assets/js/graph.js | 2 +- content/_index.md | 3 ++- ... Latex Test (测试).md => CJK + Latex Support (测试).md} | 7 +++++-- content/notes/config.md | 2 ++ content/notes/troubleshooting.md | 2 +- data/config.yaml | 2 +- layouts/partials/katex.html | 3 --- 7 files changed, 12 insertions(+), 9 deletions(-) rename content/notes/{CJK + Latex Test (测试).md => CJK + Latex Support (测试).md} (82%) diff --git a/assets/js/graph.js b/assets/js/graph.js index 6a63024..f0b1f7f 100644 --- a/assets/js/graph.js +++ b/assets/js/graph.js @@ -185,7 +185,7 @@ async function drawGraph(url, baseUrl, pathColors, depth, enableDrag, enableLege const labels = graphNode.append("text") .attr("dx", 12) .attr("dy", ".35em") - .text((d) => content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || d.id.replace("-", " ")) + .text((d) => content[d.id]?.title || d.id.replace("-", " ")) .style("opacity", 0) .style("pointer-events", "none") .call(drag(simulation)); diff --git a/content/_index.md b/content/_index.md index 71f9b13..0f77665 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,12 +1,13 @@ --- title: 🪴 Quartz 3.2 --- + Host your second brain and [digital garden](https://jzhao.xyz/posts/networked-thought) for free. Quartz features 1. Extremely fast full-text search by pressing `ctrl` + `k` 2. Wikilink support 3. Display for backlinks of each note -4. [CJK + Latex Support](notes/CJK%20+%20Latex%20Test%20(测试).md) +4. Built-in [CJK + Latex Support (测试)](notes/CJK%20+%20Latex%20Support%20(测试).md) 5. Fully customizable local graph view 6. Endlessly powerful page and theme customization using CSS 7. Automatically generated tag and section lists of content diff --git a/content/notes/CJK + Latex Test (测试).md b/content/notes/CJK + Latex Support (测试).md similarity index 82% rename from content/notes/CJK + Latex Test (测试).md rename to content/notes/CJK + Latex Support (测试).md index fce6d91..5dc0b48 100644 --- a/content/notes/CJK + Latex Test (测试).md +++ b/content/notes/CJK + Latex Support (测试).md @@ -1,5 +1,5 @@ --- -title: "CJK + Latex Test (测试)" +title: "CJK + Latex Support (测试)" --- ## Chinese, Japanese, Korean Support @@ -35,4 +35,7 @@ $$ 1 & 2 & 3\\ a & b & c \end{bmatrix} -$$ \ No newline at end of file +$$ + +## RTL +More information on configuring RTL languages like Arabic in the [config](notes/config.md) page \ No newline at end of file diff --git a/content/notes/config.md b/content/notes/config.md index ac69f10..d04b152 100644 --- a/content/notes/config.md +++ b/content/notes/config.md @@ -49,6 +49,8 @@ More info about partials on [Hugo's website.](https://gohugo.io/templates/partia Still having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). ## Multilingual +[CJK + Latex Support (测试)](notes/CJK%20+%20Latex%20Support%20(测试).md) comes out of the box with Quartz. + Want to support languages that read from right-to-left (like Arabic)? Hugo (and by proxy, Quartz) supports this natively. Follow the steps [Hugo provides here](https://gohugo.io/content-management/multilingual/#configure-languages) and modify your `config.toml` diff --git a/content/notes/troubleshooting.md b/content/notes/troubleshooting.md index 765d582..66eb879 100644 --- a/content/notes/troubleshooting.md +++ b/content/notes/troubleshooting.md @@ -7,7 +7,7 @@ Still having trouble? Here are a list of common questions and problems people en While you're here, join our [Discord](https://discord.gg/cRFFHYye7t) :) ### Does Quartz have Latex support? -Yes! See [CJK + Latex Test (测试)](CJK%20+%20Latex%20Test%20(测试).md) for a brief demo. +Yes! See [CJK + Latex Support (测试)](notes/CJK%20+%20Latex%20Support%20(测试).md) for a brief demo. ### Can I use \ in Quartz? Unless it produces direct Markdown output in the file, no. There currently is no way to bundle plugin code with Quartz. diff --git a/data/config.yaml b/data/config.yaml index b10399b..c59c0e0 100644 --- a/data/config.yaml +++ b/data/config.yaml @@ -6,7 +6,7 @@ description: Host your second brain and digital garden for free. Quartz features extremely fast full-text search, Wikilink support, backlinks, local graph, tags, and link previews. page_title: - "🪴 Quartz .2" + "🪴 Quartz 3.2" links: - link_name: Twitter link: https://twitter.com/_jzhao diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html index f6477f8..4670c69 100644 --- a/layouts/partials/katex.html +++ b/layouts/partials/katex.html @@ -5,15 +5,12 @@