From b9d7adafccc7a77f735afe11c80e0e8db534a31d Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 23 Dec 2021 13:18:03 -0800 Subject: [PATCH 01/71] Create FUNDING.yml --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..40b2d4a3a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [jackyzha0] From 09b5522a488177129bfc7b35b700d7e76c64d5f8 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 23 Dec 2021 13:22:22 -0800 Subject: [PATCH 02/71] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 32 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..189648d9c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Something about Quartz isn't working the way you expect +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..2c9c226d9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea or improvement for Quartz +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 091be7040b2f3da212a68a491bb8872543fddfea Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 23 Dec 2021 13:37:29 -0800 Subject: [PATCH 03/71] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..c624fd59e --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,93 @@ +# Citizen Code of Conduct + +## 1. Purpose + +A primary goal of the Quartz community is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof). + +This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior. + +We invite all those who participate in the Quartz community to help us create safe and positive experiences for everyone. + +## 2. Open [Source/Culture/Tech] Citizenship + +A supplemental goal of this Code of Conduct is to increase open [source/culture/tech] citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community. + +Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society. + +If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know. + +## 3. Expected Behavior + +The following behaviors are expected and requested of all community members: + + * Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community. + * Exercise consideration and respect in your speech and actions. + * Attempt collaboration before conflict. + * Refrain from demeaning, discriminatory, or harassing behavior and speech. + * Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential. + * Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations. + +## 4. Unacceptable Behavior + +The following behaviors are considered harassment and are unacceptable within our community: + + * Violence, threats of violence or violent language directed against another person. + * Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. + * Posting or displaying sexually explicit or violent material. + * Posting or threatening to post other people's personally identifying information ("doxing"). + * Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. + * Inappropriate photography or recording. + * Inappropriate physical contact. You should have someone's consent before touching them. + * Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances. + * Deliberate intimidation, stalking or following (online or in person). + * Advocating for, or encouraging, any of the above behavior. + * Sustained disruption of community events, including talks and presentations. + +## 5. Weapons Policy + +No weapons will be allowed at Quartz community events, community spaces, or in other spaces covered by the scope of this Code of Conduct. Weapons include but are not limited to guns, explosives (including fireworks), and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon. Community members are further expected to comply with all state and local laws on this matter. + +## 6. Consequences of Unacceptable Behavior + +Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated. + +Anyone asked to stop unacceptable behavior is expected to comply immediately. + +If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event). + +## 7. Reporting Guidelines + +If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. j.zhao2k19@gmail.com. + + + +Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress. + +## 8. Addressing Grievances + +If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify @jackyzha0 with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies. + + +## 9. Scope + +We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues--online and in-person--as well as in all one-on-one communications pertaining to community business. + +This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members. + +## 10. Contact info + +j.zhao2k19@gmail.com + +## 11. License and attribution + +The Citizen Code of Conduct is distributed by [Stumptown Syndicate](http://stumptownsyndicate.org) under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/). + +Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy). + +_Revision 2.3. Posted 6 March 2017._ + +_Revision 2.2. Posted 4 February 2016._ + +_Revision 2.1. Posted 23 June 2014._ + +_Revision 2.0, adopted by the [Stumptown Syndicate](http://stumptownsyndicate.org) board on 10 January 2013. Posted 17 March 2013._ From 56d2382c282431115b2964d440b790ce11f19e72 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 23 Dec 2021 14:05:27 -0800 Subject: [PATCH 04/71] fix relative link styling, change graph and backlinks to refer to name rather than path --- assets/base.scss | 10 ++++------ content/_index.md | 2 +- layouts/partials/backlinks.html | 5 +++-- layouts/partials/graph.html | 13 +++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/assets/base.scss b/assets/base.scss index bd0b6091e..f50e9cc9e 100644 --- a/assets/base.scss +++ b/assets/base.scss @@ -128,9 +128,6 @@ td, th { article a { font-family: Source Sans Pro; font-weight: 600; - text-decoration: underline; - text-decoration-color: var(--tertiary); - text-decoration-thickness: .15em; } sup > a { @@ -191,10 +188,11 @@ hr { } // internal link -a[href^="/"] { +a[href^="./"] { text-decoration: none; - background-color: #afbfc922; + background-color: #afbfc933; padding: 0 0.2em; + font-weight: 600; border-radius: 3px; } @@ -370,4 +368,4 @@ header { } } } -} \ No newline at end of file +} diff --git a/content/_index.md b/content/_index.md index d9815914d..5f2e26713 100644 --- a/content/_index.md +++ b/content/_index.md @@ -15,4 +15,4 @@ Not convinced yet? Look at some [community digital gardens](moc/showcase) built ## Troubleshooting - 🚧 [Troubleshooting and FAQ](notes/troubleshooting.md) -- πŸ› [Submit an Issue](https://github.com/jackyzha0/quartz/issues) \ No newline at end of file +- πŸ› [Submit an Issue](https://github.com/jackyzha0/quartz/issues) diff --git a/layouts/partials/backlinks.html b/layouts/partials/backlinks.html index 744f7e369..9020bf7e8 100644 --- a/layouts/partials/backlinks.html +++ b/layouts/partials/backlinks.html @@ -4,13 +4,14 @@ {{$host := strings.TrimRight "/" $url.Path }} {{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }} {{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}} + {{$contentTable := $.Site.Data.contentIndex}} {{if $inbound}} {{- range $inbound -}} {{$src := index . "source"}} {{$src = replace $src " " "-"}}
  • - {{index . "source"}} + {{index (index $contentTable $src) "title"}}
  • {{- end -}} {{else}} @@ -18,4 +19,4 @@ No backlinks found {{end}} - \ No newline at end of file + diff --git a/layouts/partials/graph.html b/layouts/partials/graph.html index dbd33d1b4..a9637431e 100644 --- a/layouts/partials/graph.html +++ b/layouts/partials/graph.html @@ -13,6 +13,7 @@ \ No newline at end of file + From 69c86e407fa14ea94c75de82ca55ec9efaf6fb37 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 23 Dec 2021 14:21:39 -0800 Subject: [PATCH 05/71] update subdomain docs --- assets/base.scss | 2 +- content/notes/hosting.md | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/assets/base.scss b/assets/base.scss index f50e9cc9e..982dc07d3 100644 --- a/assets/base.scss +++ b/assets/base.scss @@ -233,7 +233,7 @@ a[href^="./"] { & #graph-container { border: var(--outlinegray) 1px solid; - border-radius: 5px + border-radius: 5px; } } diff --git a/content/notes/hosting.md b/content/notes/hosting.md index c6027bb98..703fdfd66 100644 --- a/content/notes/hosting.md +++ b/content/notes/hosting.md @@ -39,15 +39,21 @@ Now let's get this site up and running. Never hosted a site before? No problem. Here, we take advantage of GitHub's free page hosting to deploy our site. Change `baseURL` in `/config.toml`. If you don't have a custom domain to use, you can use `.github.io` (which GitHub gives to you for free!) as your domain. -[Reference.](https://github.com/jackyzha0/quartz/blob/hugo/config.toml) +[Reference `config.toml` here](https://github.com/jackyzha0/quartz/blob/hugo/config.toml) ```toml baseURL = "https:///" ``` +If you are using this under a subdomain (e.g. `.github.io/quartz`), include the trailing path. + +```toml +baseURL = "https://.github.io/quartz/" +``` + Change `cname` in `/.github/workflows/deploy.yaml`. Again, if you don't have a custom domain to use, you can use `.github.io`. -[Reference.](https://github.com/jackyzha0/quartz/blob/hugo/.github/workflows/deploy.yaml) +[Reference `deploy.yaml` here](https://github.com/jackyzha0/quartz/blob/hugo/.github/workflows/deploy.yaml) ```yaml - name: Deploy @@ -82,4 +88,4 @@ Now that your Quartz is live, let's figure out how to make Quartz really *yours* 🎨 [Customizing Quartz](notes/config.md) -Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). \ No newline at end of file +Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). From 3a98c8b554c4b0e141f46a777c0fefe5ad4d4178 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 23 Dec 2021 14:32:47 -0800 Subject: [PATCH 06/71] actually display site title --- config.toml | 3 ++- layouts/_default/single.html | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/config.toml b/config.toml index dabe513d1..81297a20a 100644 --- a/config.toml +++ b/config.toml @@ -8,6 +8,7 @@ ignoreFiles = [ "/content/templates/*", "/content/private/*", ] +title = "πŸͺ΄ Quartz v3" [markup] [markup.tableOfContents] @@ -24,4 +25,4 @@ ignoreFiles = [ lineNos = true lineNumbersInTable = true style = "dracula" - tabWidth = 4 \ No newline at end of file + tabWidth = 4 diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 9f6443d1a..a5302f04f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,19 +7,20 @@
    - {{if .Title}}

    {{ .Title }}

    {{end}} - Search IconIcon to open search -
    - {{partial "darkmode.html" .}} -
    -
    - {{if $.Site.Data.config.enableToc}} - - {{end}} - {{.Content}} +

    {{ .Site.Title }}

    + Search IconIcon to open search +
    + {{partial "darkmode.html" .}} + +
    + {{if .Title}}

    {{ .Title }}

    {{end}} + {{if $.Site.Data.config.enableToc}} + + {{end}} + {{.Content}}
    {{partial "footer.html" .}}
    From 48d01810c4629341d9481632fc7f769dcffe0bd7 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 23 Dec 2021 14:40:59 -0800 Subject: [PATCH 07/71] fix config setting, fix font size for h1 in article --- assets/base.scss | 4 ++++ config.toml | 1 - data/config.yaml | 4 ++-- layouts/_default/single.html | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/assets/base.scss b/assets/base.scss index 982dc07d3..c38263fab 100644 --- a/assets/base.scss +++ b/assets/base.scss @@ -241,6 +241,10 @@ a[href^="./"] { margin-top: 30vh; } +article > h1 { + font-size: 2em; +} + header { display: flex; flex-direction: row; diff --git a/config.toml b/config.toml index 81297a20a..e0a9e557e 100644 --- a/config.toml +++ b/config.toml @@ -8,7 +8,6 @@ ignoreFiles = [ "/content/templates/*", "/content/private/*", ] -title = "πŸͺ΄ Quartz v3" [markup] [markup.tableOfContents] diff --git a/data/config.yaml b/data/config.yaml index 49479077b..1ca6d1984 100644 --- a/data/config.yaml +++ b/data/config.yaml @@ -4,9 +4,9 @@ description: Here is the page description. This is an example Quartz site that details installation, setup, customization, and troubleshooting for Quartz itself. page_title: - Quartz Example Page + "πŸͺ΄ Quartz v3" links: - link_name: Twitter link: https://twitter.com/_jzhao - link_name: Github - link: https://github.com/jackyzha0 \ No newline at end of file + link: https://github.com/jackyzha0 diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a5302f04f..cbf70a2a7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,7 +7,7 @@
    -

    {{ .Site.Title }}

    +

    {{ .Site.Data.config.page_title }}

    Search IconIcon to open search
    {{partial "darkmode.html" .}} From 5bd5642c99d6d144c9932533dfdc3484bdb72b71 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Fri, 24 Dec 2021 09:48:22 -0500 Subject: [PATCH 08/71] add toLowerCase to id --- layouts/partials/search.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/search.html b/layouts/partials/search.html index b12b731ac..9809de67e 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -145,7 +145,7 @@ } const redir = (id, term) => { - window.location.href = "{{.Site.BaseURL}}" + `${id}#:~:text=${encodeURIComponent(term)}` + window.location.href = "{{.Site.BaseURL}}" + `${id.toLowerCase()}#:~:text=${encodeURIComponent(term)}` } const fetch = id => ({ @@ -252,4 +252,4 @@ }) }) - \ No newline at end of file + From 2ba01c831178facd35c62adcb22f3cc39ead6975 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Fri, 24 Dec 2021 15:51:37 -0500 Subject: [PATCH 09/71] fix untitled #36 --- layouts/partials/graph.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/graph.html b/layouts/partials/graph.html index a9637431e..7dcd5365d 100644 --- a/layouts/partials/graph.html +++ b/layouts/partials/graph.html @@ -185,7 +185,7 @@ const labels = graphNode.append("text") .attr("dx", 12) .attr("dy", ".35em") - .text((d) => content[d.id.replace("%20", "-")].title) + .text((d) => content[d.id.replace("%20", "-")]?.title || "Untitled") .style("opacity", 0) .style("pointer-events", "none") .call(drag(simulation)); From 43837f9e2ec4033722cb6957bd67c688afb3ae2c Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 25 Dec 2021 23:45:30 -0500 Subject: [PATCH 10/71] add makefile, fix link padding, test capitalization --- Makefile | 7 +++++ assets/base.scss | 45 ++++++++++++++++---------------- config.toml | 2 +- content/_index.md | 2 +- content/notes/editing.md | 4 +-- content/notes/troubleshooting.md | 2 +- layouts/index.html | 2 +- layouts/partials/search.html | 2 +- 8 files changed, 37 insertions(+), 29 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..cdc2ffa11 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.DEFAULT_GOAL := serve + +help: ## Show all Makefile targets + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +serve: ## serve + hugo-obsidian -input=content -output=data -index && hugo server diff --git a/assets/base.scss b/assets/base.scss index c38263fab..4d195c3f4 100644 --- a/assets/base.scss +++ b/assets/base.scss @@ -23,19 +23,6 @@ p, ul, text { padding: revert; } -a { - font-family: Inter; - font-weight: 700; - font-size: 1em; - text-decoration: none; - transition: all 0.2s ease; - color: var(--secondary); - - &:hover { - color: var(--tertiary) !important; - } -} - #TableOfContents > ol { counter-reset: section; margin-left: 0em; @@ -128,6 +115,16 @@ td, th { article a { font-family: Source Sans Pro; font-weight: 600; + + // internal link + &[href^="./"], &[href^="/"] { + text-decoration: none; + background-color: #afbfc933; + padding: 0 0.2em; + margin-right: -0.2em; + font-weight: 600; + border-radius: 3px; + } } sup > a { @@ -135,6 +132,19 @@ sup > a { padding: 0 0.1em 0 0.2em; } +a { + font-family: Inter, sans-serif; + font-weight: 700; + font-size: 1em; + text-decoration: none; + transition: all 0.2s ease; + color: var(--secondary); + + &:hover { + color: var(--tertiary) !important; + } +} + pre { font-family: 'Fira Code'; padding: 0.75em; @@ -187,15 +197,6 @@ hr { background-color: var(--dark); } -// internal link -a[href^="./"] { - text-decoration: none; - background-color: #afbfc933; - padding: 0 0.2em; - font-weight: 600; - border-radius: 3px; -} - .singlePage { margin: 4em 30vw; diff --git a/config.toml b/config.toml index e0a9e557e..109734180 100644 --- a/config.toml +++ b/config.toml @@ -2,7 +2,7 @@ baseURL = "https://quartz.jzhao.xyz/" languageCode = "en-us" googleAnalytics = "G-XYFD95KB4J" pygmentsUseClasses = true -relativeURLs = true +relativeURLs = false disablePathToLower = true ignoreFiles = [ "/content/templates/*", diff --git a/content/_index.md b/content/_index.md index 5f2e26713..be2b78f09 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,5 +1,5 @@ --- -title: πŸͺ΄ Quartz v2.1 +title: πŸͺ΄ Quartz 3 --- 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 `/` diff --git a/content/notes/editing.md b/content/notes/editing.md index db2622976..3c24424a2 100644 --- a/content/notes/editing.md +++ b/content/notes/editing.md @@ -8,7 +8,7 @@ Quartz runs on top of [Hugo](https://gohugo.io/) so all notes are written in [Ma ### Obsidian I *strongly* recommend using [Obsidian](http://obsidian.md/) as a way to edit and grow your digital garden. It comes with a really nice editor and graphical interface to preview all of my local files. -**πŸ”— [How to link your Obsidian Vault](notes/obsidian.md)** +πŸ”— How to link your Obsidian Vault](notes/Obsidian.md) Of course, all the files are in Markdown so you could just use your favourite text editor of choice. @@ -54,4 +54,4 @@ Now that you know the basics of managing your digital garden using Quartz, you c 🌍 [Hosting Quartz online!](notes/hosting.md) -Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). \ No newline at end of file +Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). diff --git a/content/notes/troubleshooting.md b/content/notes/troubleshooting.md index a0bf56968..7e65cd69b 100644 --- a/content/notes/troubleshooting.md +++ b/content/notes/troubleshooting.md @@ -25,7 +25,7 @@ source ~/.bash_profile ``` ### How come my notes aren't being rendered? -You probably forgot to include front matter in your Markdown files. You can either setup [Obsidian](notes/obsidian) to do this for you or you need to manually define it. More details in [the 'how to edit' guide](notes/editing.md). +You probably forgot to include front matter in your Markdown files. You can either setup [Obsidian](notes/Obsidian) to do this for you or you need to manually define it. More details in [the 'how to edit' guide](notes/editing.md). ### My custom domain isn't working! Walk through the steps in [the hosting guide](notes/hosting.md) again. Make sure you wait 30 min to 1 hour for changes to take effect. diff --git a/layouts/index.html b/layouts/index.html index ce667445f..06fcb9501 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -7,7 +7,7 @@
    - {{if .Title}}

    {{ .Title }}

    {{end}} +

    {{if .Title}}{{ .Title }}{{else}}Untitled{{end}}

    Search IconIcon to open search
    {{partial "darkmode.html" .}} diff --git a/layouts/partials/search.html b/layouts/partials/search.html index 9809de67e..90f4040a7 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -145,7 +145,7 @@ } const redir = (id, term) => { - window.location.href = "{{.Site.BaseURL}}" + `${id.toLowerCase()}#:~:text=${encodeURIComponent(term)}` + window.location.href = "{{.Site.BaseURL}}" + `${id}#:~:text=${encodeURIComponent(term)}` } const fetch = id => ({ From 6fbfa7170b17e062abd4c26e4b55a3934fb4ff1c Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 26 Dec 2021 00:09:15 -0500 Subject: [PATCH 11/71] various font and colour fixes --- assets/base.scss | 14 +++++++++----- assets/custom.scss | 2 +- layouts/partials/head.html | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/assets/base.scss b/assets/base.scss index 4d195c3f4..7d3acdc0d 100644 --- a/assets/base.scss +++ b/assets/base.scss @@ -119,14 +119,18 @@ article a { // internal link &[href^="./"], &[href^="/"] { text-decoration: none; - background-color: #afbfc933; - padding: 0 0.2em; - margin-right: -0.2em; - font-weight: 600; + background-color: transparentize(#8f9fa9, 0.85); + padding: 0 0.1em; + margin: auto -0.1em; border-radius: 3px; } } +.backlinks a { + font-weight: 600; + font-size: 0.9rem; +} + sup > a { text-decoration: none; padding: 0 0.1em 0 0.2em; @@ -134,8 +138,8 @@ sup > a { a { font-family: Inter, sans-serif; - font-weight: 700; font-size: 1em; + font-weight: 700; text-decoration: none; transition: all 0.2s ease; color: var(--secondary); diff --git a/assets/custom.scss b/assets/custom.scss index cb8babb35..612b80a61 100644 --- a/assets/custom.scss +++ b/assets/custom.scss @@ -14,7 +14,7 @@ [saved-theme="dark"] { --light: #1e1e21 !important; --dark: #fbfffe !important; - --secondary: #5b778a !important; + --secondary: #6b879a !important; --visited: #4a575e !important; --tertiary: #84a59d !important; --primary: #f58382 !important; diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 3810078cc..6814aed98 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -7,7 +7,7 @@ - + {{ $css := slice "custom.scss" "base.scss" "darkmode.scss" "syntax.scss"}} {{range $css}} {{$sass := resources.Get . | resources.ToCSS }} From 165d33810d63f98953f4dd8c40f6d7741f967664 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 26 Dec 2021 21:13:21 -0500 Subject: [PATCH 12/71] base tags --- content/notes/config.md | 2 ++ content/notes/editing.md | 2 ++ content/notes/hosting.md | 2 ++ content/notes/obsidian.md | 2 ++ content/notes/setup.md | 2 ++ 5 files changed, 10 insertions(+) diff --git a/content/notes/config.md b/content/notes/config.md index f70147379..6f5ef740b 100644 --- a/content/notes/config.md +++ b/content/notes/config.md @@ -1,5 +1,7 @@ --- title: "Configuration" +tags: +- setup --- ## Configuration diff --git a/content/notes/editing.md b/content/notes/editing.md index 3c24424a2..e53fcc791 100644 --- a/content/notes/editing.md +++ b/content/notes/editing.md @@ -1,5 +1,7 @@ --- title: "Editing Content in Quartz" +tags: +- setup --- ## Editing diff --git a/content/notes/hosting.md b/content/notes/hosting.md index 703fdfd66..9e26ad2bb 100644 --- a/content/notes/hosting.md +++ b/content/notes/hosting.md @@ -1,5 +1,7 @@ --- title: "Deploying Quartz to the Web" +tags: +- setup --- ## GitHub Pages diff --git a/content/notes/obsidian.md b/content/notes/obsidian.md index 52931ca28..d37ba6cab 100644 --- a/content/notes/obsidian.md +++ b/content/notes/obsidian.md @@ -1,5 +1,7 @@ --- title: "Obsidian Vault Integration" +tags: +- setup --- ## Setup diff --git a/content/notes/setup.md b/content/notes/setup.md index 2cd463d7f..4b8d1595e 100644 --- a/content/notes/setup.md +++ b/content/notes/setup.md @@ -1,5 +1,7 @@ --- title: "Setup" +tags: +- setup --- ## Making your own Quartz From 39592347cc742838a1d078031b897fe26a94adaf Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 27 Dec 2021 13:06:58 -0500 Subject: [PATCH 13/71] add graph depth config --- data/graphConfig.yaml | 1 + layouts/_default/section.html | 0 layouts/partials/graph.html | 33 +++++++++++++++++++++++++++------ 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 layouts/_default/section.html diff --git a/data/graphConfig.yaml b/data/graphConfig.yaml index 4104e428a..3f8d3fb6b 100644 --- a/data/graphConfig.yaml +++ b/data/graphConfig.yaml @@ -1,5 +1,6 @@ enableLegend: false enableDrag: true enableZoom: true +depth: -1 # set to -1 to show full graph paths: - /moc: "#4388cc" \ No newline at end of file diff --git a/layouts/_default/section.html b/layouts/_default/section.html new file mode 100644 index 000000000..e69de29bb diff --git a/layouts/partials/graph.html b/layouts/partials/graph.html index 7dcd5365d..e8cd9665a 100644 --- a/layouts/partials/graph.html +++ b/layouts/partials/graph.html @@ -16,12 +16,35 @@ const content = {{$.Site.Data.contentIndex}} const curPage = {{ strings.TrimRight "/" .Page.RelPermalink }} const pathColors = {{$.Site.Data.graphConfig.paths}} + let depth = {{$.Site.Data.graphConfig.depth}} const parseIdsFromLinks = (links) => [...(new Set(links.flatMap(link => ([link.source, link.target]))))] + const neighbours = new Set() + const wl = [curPage || "/", "__SENTINEL"] + if (depth >= 0) { + while (depth >= 0 && wl.length > 0) { + // compute neighbours + const cur = wl.shift() + console.log(depth, cur, wl) + if (cur === "__SENTINEL") { + depth-- + wl.push("__SENTINEL") + } else { + neighbours.add(cur) + const outgoing = index.links[cur] || [] + const incoming = index.backlinks[cur] || [] + console.log(incoming) + wl.push(...outgoing.map(l => l.target), ...incoming.map(l => l.source)) + } + } + } else { + parseIdsFromLinks(links).forEach(id => neighbours.add(id)) + } + const data = { - nodes: parseIdsFromLinks(links).map(id => ({id})), - links, + nodes: [...neighbours].map(id => ({id})), + links: links.filter(l => neighbours.has(l.source) && neighbours.has(l.target)), } const color = (d) => { @@ -70,10 +93,8 @@ const width = document.getElementById("graph-container").offsetWidth const simulation = d3.forceSimulation(data.nodes) - .force("charge", d3.forceManyBody().strength(-20)) - .force("link", d3.forceLink(data.links) - .id(d => d.id) - ) + .force("charge", d3.forceManyBody().strength(-30)) + .force("link", d3.forceLink(data.links).id(d => d.id)) .force("center", d3.forceCenter()); const svg = d3.select('#graph-container') From 094ab9d064b8e3d24f0cb656aaf4e0ea08365ac5 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 27 Dec 2021 13:15:10 -0500 Subject: [PATCH 14/71] dedupe backlinks --- content/notes/config.md | 1 + layouts/partials/backlinks.html | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/content/notes/config.md b/content/notes/config.md index 6f5ef740b..a5c194fc8 100644 --- a/content/notes/config.md +++ b/content/notes/config.md @@ -29,6 +29,7 @@ To customize the Interactive Graph view, you can poke around `data/graphConfig.y enableLegend: false # automatically generate a legend enableDrag: true # allow dragging nodes in the graph enableZoom: true # allow zooming and panning the graph +depth: -1 # how many neighbours of the current node to show (-1 is all nodes) paths: # colour specific nodes path off of their path - /moc: "#4388cc" ``` diff --git a/layouts/partials/backlinks.html b/layouts/partials/backlinks.html index 9020bf7e8..daee6ec77 100644 --- a/layouts/partials/backlinks.html +++ b/layouts/partials/backlinks.html @@ -6,12 +6,10 @@ {{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}} {{$contentTable := $.Site.Data.contentIndex}} {{if $inbound}} - {{- range $inbound -}} - {{$src := index . "source"}} - {{$src = replace $src " " "-"}} - + {{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}} + {{- range $cleanedInbound | uniq -}}
  • - {{index (index $contentTable $src) "title"}} + {{index (index $contentTable .) "title"}}
  • {{- end -}} {{else}} From b4e26971165d49604014a1ed38aaa18b2c20fc23 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 27 Dec 2021 15:59:19 -0500 Subject: [PATCH 15/71] content section --- assets/base.scss | 30 ++++++++++++++++++++++------ config.toml | 1 + content/_index.md | 7 +++++++ layouts/_default/section.html | 37 +++++++++++++++++++++++++++++++++++ layouts/partials/contact.html | 12 ++++++++++++ layouts/partials/footer.html | 13 +----------- 6 files changed, 82 insertions(+), 18 deletions(-) create mode 100644 layouts/partials/contact.html diff --git a/assets/base.scss b/assets/base.scss index 7d3acdc0d..c9340a9b2 100644 --- a/assets/base.scss +++ b/assets/base.scss @@ -81,12 +81,8 @@ p, tbody, li { line-height: 1.5em; } -h2 { - opacity: 0.85; -} - -h3 { - opacity: 0.75; +h2, h3 { + opacity: 0.9; } blockquote { @@ -378,3 +374,25 @@ header { } } } + +.section-ul { + list-style: none; + padding-left: 0; + + & > li { + border: 1px solid var(--outlinegray); + border-radius: 5px; + padding: 0 1em; + margin-bottom: 1em; + + & h3 { + opacity: 1; + font-weight: 700; + margin-bottom: 0em; + } + + & .meta { + opacity: 0.6; + } + } +} \ No newline at end of file diff --git a/config.toml b/config.toml index 109734180..e4f3d0ac1 100644 --- a/config.toml +++ b/config.toml @@ -8,6 +8,7 @@ ignoreFiles = [ "/content/templates/*", "/content/private/*", ] +summaryLength = 35 [markup] [markup.tableOfContents] diff --git a/content/_index.md b/content/_index.md index be2b78f09..8c3a0eb69 100644 --- a/content/_index.md +++ b/content/_index.md @@ -7,12 +7,19 @@ Host your second brain and [digital garden](https://jzhao.xyz/posts/digital-gard 3. Display for backlinks of each note 4. A customizable graph view 5. Endlessly powerful page and theme customization +6. Automatically generated tag and section lists of content ## 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, or read about [why I made Quartz](notes/philosophy.md) to begin with! +## Content Lists +If you prefer browsing the contents of this site through a list instead of a graph, you can find content lists here too: + +- [All Notes](/notes) +- [Setup-related Notes](/tags/setup) + ## Troubleshooting - 🚧 [Troubleshooting and FAQ](notes/troubleshooting.md) - πŸ› [Submit an Issue](https://github.com/jackyzha0/quartz/issues) diff --git a/layouts/_default/section.html b/layouts/_default/section.html index e69de29bb..d6e24b4fa 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -0,0 +1,37 @@ + + +{{ partial "head.html" . }} + + +{{partial "search.html" .}} +
    + +
    +

    {{ .Site.Data.config.page_title }}

    + Search IconIcon to open search +
    + {{partial "darkmode.html" .}} +
    +
    +

    All {{.Title}}

    +
      + {{- range .Pages -}} +
    • +
      +
      +

      {{- .Title -}}

      +

      {{- .Summary -}}{{if .Truncated}}...{{end}}

      +
      +

      + {{ .ReadingTime }} minute read +

      +
      +
    • + {{- end -}} +
    +
    + {{partial "contact.html" .}} +
    + + + diff --git a/layouts/partials/contact.html b/layouts/partials/contact.html new file mode 100644 index 000000000..748cb0615 --- /dev/null +++ b/layouts/partials/contact.html @@ -0,0 +1,12 @@ + +
    +
    +

    Made by {{ $.Site.Data.config.name }} using Quartz, Β© {{ dateFormat "2006" now }}

    + {{ if not .IsHome }} + Home + {{end}} + {{- range $.Site.Data.config.links -}} + {{.link_name}} + {{- end -}} +
    +
    \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 416b16733..6d4ef17b9 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -8,15 +8,4 @@
    - -
    -
    -

    Made by {{ $.Site.Data.config.name }} using Quartz, Β© {{ dateFormat "2006" now }}

    - {{ if not .IsHome }} - Home - {{end}} - {{- range $.Site.Data.config.links -}} - {{.link_name}} - {{- end -}} -
    -
    \ No newline at end of file +{{partial "contact.html" .}} \ No newline at end of file From e1911a58fff3b96754b3b49837ac2d4dd4fcf5aa Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 27 Dec 2021 17:28:53 -0500 Subject: [PATCH 16/71] enable last modified info --- .github/workflows/deploy.yaml | 2 +- Makefile | 2 +- assets/base.scss | 29 ++++++++++++++++++----------- config.toml | 1 + layouts/_default/single.html | 4 ++++ 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c19bec8fd..fc3a5c23d 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.5 + uses: jackyzha0/hugo-obsidian@v2.6 with: index: true input: content diff --git a/Makefile b/Makefile index cdc2ffa11..88605ebbe 100644 --- a/Makefile +++ b/Makefile @@ -4,4 +4,4 @@ help: ## Show all Makefile targets @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' serve: ## serve - hugo-obsidian -input=content -output=data -index && hugo server + hugo-obsidian -input=content -output=data -index -root=. && hugo server diff --git a/assets/base.scss b/assets/base.scss index c9340a9b2..571ca2292 100644 --- a/assets/base.scss +++ b/assets/base.scss @@ -108,18 +108,25 @@ td, th { margin: 0.5em 0; } -article a { - font-family: Source Sans Pro; - font-weight: 600; +article { + & > .meta { + margin: -1.5em 0 1em 0; + opacity: 0.7; + } - // internal link - &[href^="./"], &[href^="/"] { - text-decoration: none; - background-color: transparentize(#8f9fa9, 0.85); - padding: 0 0.1em; - margin: auto -0.1em; - border-radius: 3px; - } + & a { + font-family: Source Sans Pro; + font-weight: 600; + + // internal link + &[href^="./"], &[href^="/"] { + text-decoration: none; + background-color: transparentize(#8f9fa9, 0.85); + padding: 0 0.1em; + margin: auto -0.1em; + border-radius: 3px; + } + } } .backlinks a { diff --git a/config.toml b/config.toml index e4f3d0ac1..a0d71f754 100644 --- a/config.toml +++ b/config.toml @@ -9,6 +9,7 @@ ignoreFiles = [ "/content/private/*", ] summaryLength = 35 +enableGitInfo = true [markup] [markup.tableOfContents] diff --git a/layouts/_default/single.html b/layouts/_default/single.html index cbf70a2a7..d78d300b7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -14,6 +14,9 @@
    {{if .Title}}

    {{ .Title }}

    {{end}} +

    + Last updated {{ .Lastmod.Format "January 2, 2006" }} +

    {{if $.Site.Data.config.enableToc}} {{end}} {{.Content}} +
    {{partial "footer.html" .}} From 612c44d719f1b47b3c7b3fc5b6ffb48ccec33ded Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 27 Dec 2021 17:34:53 -0500 Subject: [PATCH 17/71] modify obsidian --- content/notes/obsidian.md | 2 +- layouts/_default/section.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/notes/obsidian.md b/content/notes/obsidian.md index d37ba6cab..ff2c98238 100644 --- a/content/notes/obsidian.md +++ b/content/notes/obsidian.md @@ -21,7 +21,7 @@ Under Options > Files and Links, set the New link format to always be Absolute P ![Obsidian Settings](/notes/images/obsidian-settings.png)*Obsidian Settings* ## Templates -Inserting front matter everytime you want to create a new Note gets really annoying really quickly. Luckily, Obsidian supports templates which makes inserting new content really easily. +Inserting front matter everytime you want to create a new Note gets annoying really quickly. Luckily, Obsidian supports templates which makes inserting new content really easily. **If you decide to overwrite the `/content` folder completely, don't remove the `/content/templates` folder!** diff --git a/layouts/_default/section.html b/layouts/_default/section.html index d6e24b4fa..8845fc5f8 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -15,7 +15,7 @@

    All {{.Title}}

    {{partial "contact.html" .}} +{{partial "popover.html" .}} diff --git a/layouts/_default/term.html b/layouts/_default/term.html index 58f024bcc..16ea85cf8 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -19,6 +19,7 @@ {{partial "contact.html" .}} +{{partial "popover.html" .}} diff --git a/layouts/index.html b/layouts/index.html index 17b691734..f0cd68e77 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -22,6 +22,7 @@ {{- .Content -}} {{partial "footer.html" .}} + {{partial "popover.html" .}} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 4085dd52b..80893010a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -43,4 +43,3 @@ {{ template "_internal/google_analytics.html" . }} -{{ partial "popover.html" .}} From 8779e72c77c2e454d444b86d3d5ebda9bfab46d7 Mon Sep 17 00:00:00 2001 From: Claudio Yanes Date: Fri, 4 Mar 2022 03:34:45 +0000 Subject: [PATCH 60/71] Add attribute property to scripts from jsdelivr Adding the integrity attribute protects the website (by refusing to load the script) against malicious modifications of the script in the case of jsdelivr gets hacked --- layouts/partials/graph.html | 2 +- layouts/partials/search.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/graph.html b/layouts/partials/graph.html index 31d008cdd..ca379689b 100644 --- a/layouts/partials/graph.html +++ b/layouts/partials/graph.html @@ -1,4 +1,4 @@ - +

    Interactive Graph