From ae2f7efde0eb997ab2f7be1cf1513af7f99df599 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Sat, 28 Aug 2021 20:58:14 -0400 Subject: [PATCH 01/10] update showcase --- content/moc/showcase.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/moc/showcase.md b/content/moc/showcase.md index e1cb9a1..20e6a14 100644 --- a/content/moc/showcase.md +++ b/content/moc/showcase.md @@ -11,5 +11,6 @@ Want to see what Quartz can do? Here are some cool community gardens :) - [Shihyu's PKM](https://shihyuho.github.io/pkm/) - [Chloe's Garden](https://garden.chloeabrasada.online/) - [SlRvb's Site](https://slrvb.github.io/Site/) +- [Course notes for Information Technology Advanced Theory](https://a2itnotes.github.io/quartz/) If you want to see your own on here, submit a [Pull Request adding yourself to this file](https://github.com/jackyzha0/quartz/blob/hugo/content/moc/showcase.md)! From 071984a12d1c7887d0ef41b206e01bc5afefb95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Rodr=C3=ADguez?= Date: Tue, 31 Aug 2021 16:40:31 -0500 Subject: [PATCH 02/10] fix product typo in external hosting section --- content/notes/hosting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/notes/hosting.md b/content/notes/hosting.md index 7a5973c..c6027bb 100644 --- a/content/notes/hosting.md +++ b/content/notes/hosting.md @@ -80,6 +80,6 @@ Don't want to use GitHub Pages? Hugo builds everything for you! Everything is a Now that your Quartz is live, let's figure out how to make Quartz really *yours*! -🎨 [Customizing Quarts](notes/config.md) +🎨 [Customizing Quartz](notes/config.md) Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). \ No newline at end of file From 299533a4f47d2379ddbc209bcd6923a70a81e65d Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 24 Oct 2021 23:17:00 -0700 Subject: [PATCH 03/10] bump hugo-obsidian version --- .github/workflows/deploy.yaml | 2 +- README.md | 2 +- content/moc/directory.md | 19 ------------------- 3 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 content/moc/directory.md diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2190194..b36c49c 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v2 - name: Build Link Index - uses: jackyzha0/hugo-obsidian@v2.3 + uses: jackyzha0/hugo-obsidian@v2.4 with: index: true input: content diff --git a/README.md b/README.md index 079e6c1..ec80139 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Quartz Simple second brain and digital garden. -> β€œHe who works with the door open gets all kinds of interruptions, but he also occasionally gets clues as to what the world is and what might be important.” β€” Richard Hamming +> β€œ[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” β€” Richard Hamming πŸ”— Get Started: https://quartz.jzhao.xyz/ \ No newline at end of file diff --git a/content/moc/directory.md b/content/moc/directory.md deleted file mode 100644 index b77f2ee..0000000 --- a/content/moc/directory.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Quartz Documentation" ---- - -## Setup -Welcome to Quartz! Whether you're setting up a website and project for the first time or a seasoned digital gardener, I hope that you'll find something useful about this project. - -Let's get to business and get you started! - -- πŸ“š [Setup your own digital garden using Quartz](notes/setup.md) -- πŸ”— [Linking with an Obsidian Vault](notes/obsidian.md) -- 🎨 [Customizing and Styling Quartz](notes/config.md) -- 🌍 [Hosting Quartz online!](notes/hosting.md) - -Not convinced yet? Look at some [community digital gardens](moc/showcase) built with Quartz! - -## Troubleshooting -- 🚧 [Troubleshooting and FAQ](notes/troubleshooting.md) -- πŸ› [Submit an Issue](https://github.com/jackyzha0/quartz/issues) \ No newline at end of file From 6fd19069deb06988b3d34482a151a79a53b589d0 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 24 Oct 2021 23:17:13 -0700 Subject: [PATCH 04/10] search improvements --- layouts/partials/search.html | 373 ++++++++++++++++++----------------- 1 file changed, 192 insertions(+), 181 deletions(-) diff --git a/layouts/partials/search.html b/layouts/partials/search.html index e2285ea..7ee139d 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -1,208 +1,219 @@
-
- +
+
\ No newline at end of file From c1c061fbea8f6cdc6aec4992d21d2df73dc6ba4e Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 24 Oct 2021 23:17:20 -0700 Subject: [PATCH 05/10] bump docs --- content/_index.md | 12 ++++++++++-- content/notes/ignore-notes.md | 9 +++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/content/_index.md b/content/_index.md index b665a3d..0994124 100644 --- a/content/_index.md +++ b/content/_index.md @@ -18,6 +18,14 @@ I was really inspired by [Bianca](https://garden.bianca.digital/) and [Joel](htt **The goal of Quartz is to make hosting your own public digital garden free and simple.** You don't even need your own website. Quartz does all of that for you and gives your own little corner of the internet. ## Get Started -The entire Quartz documentation is fully hosted using Quartz! To get started, let's visit the main directory. +The entire Quartz documentation is fully hosted using Quartz! Whether you're setting up a website and project for the first time or a seasoned digital gardener, I hope that you'll find something useful about this project. -πŸ‘‰ [Directory](moc/directory.md) \ No newline at end of file +Let's get to business and get you started! + +> πŸ“š [Setup your own digital garden using Quartz](notes/setup.md) + +Not convinced yet? Look at some [community digital gardens](moc/showcase) built with Quartz! + +## Troubleshooting +- 🚧 [Troubleshooting and FAQ](notes/troubleshooting.md) +- πŸ› [Submit an Issue](https://github.com/jackyzha0/quartz/issues) \ No newline at end of file diff --git a/content/notes/ignore-notes.md b/content/notes/ignore-notes.md index 49bf5f3..e031421 100644 --- a/content/notes/ignore-notes.md +++ b/content/notes/ignore-notes.md @@ -15,6 +15,15 @@ ignoreFiles = [ ``` `ignoreFiles` supports the use of Regular Expressions (RegEx) so you can ignore patterns as well (e.g. ignoring all `.png`s by doing `\\.png$`). +To ignore a specific file, you can also add the tag `draft: true` to the frontmatter of a note. + +```markdown +--- +title: Some Private Note +draft: true +--- +... +``` More details in [Hugo's documentation](https://gohugo.io/getting-started/configuration/#ignore-content-and-data-files-when-rendering). From 22a9c0ddfcb38a15d4340f532faca7733349702b Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 24 Oct 2021 23:31:09 -0700 Subject: [PATCH 06/10] docs updates, add search to main page, fix redir bug --- README.md | 2 +- content/_index.md | 15 +++++++-------- layouts/index.html | 36 ++++++++++++++++++++++++------------ layouts/partials/search.html | 10 ++++++---- 4 files changed, 38 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index ec80139..abcfb68 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Quartz -Simple second brain and digital garden. +Host your own second brain and digital garden for free. > β€œ[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” β€” Richard Hamming diff --git a/content/_index.md b/content/_index.md index 0994124..4cfe1be 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,7 +1,10 @@ -# 🌱 Quartz -## v2.0 +--- +title: πŸͺ΄ Quartz v2.1 +--- -Simple second brain and [digital garden](https://jzhao.xyz/posts/digital-gardening). +Host your second brain and [digital garden](https://jzhao.xyz/posts/digital-gardening) for free. + +Curious what it can do? You're on it right now! The entire Quartz documentation is fully hosted using Quartz. ## Why Quartz? Hosting a public digital garden isn't easy. There are an overwhelming number of tutorials, resources, and guides for tools like [Notion](https://www.notion.so/), [Roam](https://roamresearch.com/), and [Obsidian](https://obsidian.md/), yet none of them have super easy to use *free* tools to publish that garden to the world. @@ -11,17 +14,13 @@ I've personally found that 2. Having a public digital garden invites open conversations 3. It makes keeping personal notes and knowledge *playful and fun* -> β€œHe who works with the door open gets all kinds of interruptions, but he also occasionally gets clues as to what the world is and what might be important.” β€” Richard Hamming +> β€œ[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” β€” Richard Hamming I was really inspired by [Bianca](https://garden.bianca.digital/) and [Joel](https://joelhooks.com/digital-garden)'s digital gardens and wanted to try making my own. **The goal of Quartz is to make hosting your own public digital garden free and simple.** You don't even need your own website. Quartz does all of that for you and gives your own little corner of the internet. ## Get Started -The entire Quartz documentation is fully hosted using Quartz! Whether you're setting up a website and project for the first time or a seasoned digital gardener, I hope that you'll find something useful about this project. - -Let's get to business and get you started! - > πŸ“š [Setup your own digital garden using Quartz](notes/setup.md) Not convinced yet? Look at some [community digital gardens](moc/showcase) built with Quartz! diff --git a/layouts/index.html b/layouts/index.html index fdc03b1..c30cd4f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,16 +1,28 @@ -{{define "head"}} + + {{ partial "head.html" . }} -{{end}} -{{define "main"}} - + +{{partial "search.html" .}}
- {{partial "darkmode.html" .}} - {{.Content}} - - -
- {{partial "footer.html" .}} -
+ +
+ {{if .Title}}

{{ .Title }}

{{end}} + Search IconIcon to open search +
+ {{partial "darkmode.html" .}} +
+
+ {{if $.Site.Data.config.enableToc}} + + {{end}} + {{- .Content -}} +
+ {{partial "footer.html" .}}
-{{end}} + + + diff --git a/layouts/partials/search.html b/layouts/partials/search.html index 7ee139d..78b7765 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -126,13 +126,17 @@ ` } + const redir = (id, term) => { + window.location.href = {{.Site.BaseURL}} + `${id}#:~:text=${encodeURIComponent(term)}` + } + const source = document.getElementById('search-bar') const results = document.getElementById("results-container") let term source.addEventListener("keyup", (e) => { if (e.key === "Enter") { const anchor = document.getElementsByClassName("result-card")[0] - window.location.href = `${anchor.id}#:~:text=${encodeURIComponent(term)}` + redir(anchor.id, term) } }) source.addEventListener('input', (e) => { @@ -163,9 +167,7 @@ .join("\n") const anchors = document.getElementsByClassName("result-card"); [...anchors].forEach(anchor => { - anchor.onclick = () => { - window.location.href = `${anchor.id}#:~:text=${encodeURIComponent(term)}` - } + anchor.onclick = () => redir(anchor.id, term) }) } }) From f56642f13cb5bffb8c05b239c6a7b90e1b6453e5 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 24 Oct 2021 23:32:55 -0700 Subject: [PATCH 07/10] forgot string lol --- layouts/partials/search.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/search.html b/layouts/partials/search.html index 78b7765..22b50a1 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -127,7 +127,7 @@ } const redir = (id, term) => { - window.location.href = {{.Site.BaseURL}} + `${id}#:~:text=${encodeURIComponent(term)}` + window.location.href = "{{.Site.BaseURL}}" + `${id}#:~:text=${encodeURIComponent(term)}` } const source = document.getElementById('search-bar') From 1835b97a7a2faf23809bb39d0bec7a2b77b3b81c Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 24 Oct 2021 23:45:55 -0700 Subject: [PATCH 08/10] better homepage --- content/_index.md | 26 +++++++------------------- content/notes/philosophy.md | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 content/notes/philosophy.md diff --git a/content/_index.md b/content/_index.md index 4cfe1be..d981591 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,29 +1,17 @@ --- title: πŸͺ΄ Quartz v2.1 --- - -Host your second brain and [digital garden](https://jzhao.xyz/posts/digital-gardening) for free. - -Curious what it can do? You're on it right now! The entire Quartz documentation is fully hosted using Quartz. - -## Why Quartz? -Hosting a public digital garden isn't easy. There are an overwhelming number of tutorials, resources, and guides for tools like [Notion](https://www.notion.so/), [Roam](https://roamresearch.com/), and [Obsidian](https://obsidian.md/), yet none of them have super easy to use *free* tools to publish that garden to the world. - -I've personally found that -1. It's nice to access notes from anywhere -2. Having a public digital garden invites open conversations -3. It makes keeping personal notes and knowledge *playful and fun* - -> β€œ[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” β€” Richard Hamming - -I was really inspired by [Bianca](https://garden.bianca.digital/) and [Joel](https://joelhooks.com/digital-garden)'s digital gardens and wanted to try making my own. - -**The goal of Quartz is to make hosting your own public digital garden free and simple.** You don't even need your own website. Quartz does all of that for you and gives your own little corner of the internet. +Host your second brain and [digital garden](https://jzhao.xyz/posts/digital-gardening) for free. Quartz features +1. Extremely fast full-text search by pressing `/` +2. Beautiful, out-of-the-box website creation and deployment +3. Display for backlinks of each note +4. A customizable graph view +5. Endlessly powerful page and theme customization ## Get Started > πŸ“š [Setup your own digital garden using Quartz](notes/setup.md) -Not convinced yet? Look at some [community digital gardens](moc/showcase) built with Quartz! +Not convinced yet? Look at some [community digital gardens](moc/showcase) built with Quartz, or read about [why I made Quartz](notes/philosophy.md) to begin with! ## Troubleshooting - 🚧 [Troubleshooting and FAQ](notes/troubleshooting.md) diff --git a/content/notes/philosophy.md b/content/notes/philosophy.md new file mode 100644 index 0000000..9325415 --- /dev/null +++ b/content/notes/philosophy.md @@ -0,0 +1,17 @@ +--- +title: Quartz Philosophy +--- + +> β€œ[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” β€” Richard Hamming + +## Why Quartz? +Hosting a public digital garden isn't easy. There are an overwhelming number of tutorials, resources, and guides for tools like [Notion](https://www.notion.so/), [Roam](https://roamresearch.com/), and [Obsidian](https://obsidian.md/), yet none of them have super easy to use *free* tools to publish that garden to the world. + +I've personally found that +1. It's nice to access notes from anywhere +2. Having a public digital garden invites open conversations +3. It makes keeping personal notes and knowledge *playful and fun* + +I was really inspired by [Bianca](https://garden.bianca.digital/) and [Joel](https://joelhooks.com/digital-garden)'s digital gardens and wanted to try making my own. + +**The goal of Quartz is to make hosting your own public digital garden free and simple.** You don't even need your own website. Quartz does all of that for you and gives your own little corner of the internet. From f7b89db8ee85e54a438db2e2cac3c55e805281c9 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 25 Oct 2021 15:00:55 -0700 Subject: [PATCH 09/10] search fix --- layouts/partials/search.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/layouts/partials/search.html b/layouts/partials/search.html index 22b50a1..ce6038f 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -1,7 +1,6 @@
- +
@@ -72,6 +71,7 @@ tokenize: "reverse", charset: "latin:extra", suggest: true, + cache: 10, }) const scrapedContent = {{$.Site.Data.contentIndex}} @@ -80,10 +80,10 @@ } const highlight = (content, term) => { - const highlightWindow = 15 + const highlightWindow = 20 const tokenizedTerm = term.split(/\s+/).filter(t => t !== "") const splitText = content.split(/\s+/).filter(t => t !== "") - const includesCheck = (token) => tokenizedTerm.some(term => token.toLowerCase().includes(term.toLowerCase())) + const includesCheck = (token) => tokenizedTerm.some(term => token.toLowerCase().startsWith(term.toLowerCase())) const occurrencesIndices = splitText .map(includesCheck) @@ -116,8 +116,7 @@ } const resultToHTML = ({url, title, content, term}) => { - const md = content.split("---")[2] - const text = removeMarkdown(md) + const text = removeMarkdown(content) const resultTitle = highlight(title, term) const resultText = highlight(text, term) return `