From 43837f9e2ec4033722cb6957bd67c688afb3ae2c Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 25 Dec 2021 23:45:30 -0500 Subject: [PATCH] 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 0000000..cdc2ffa --- /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 c38263f..4d195c3 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 e0a9e55..1097341 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 5f2e267..be2b78f 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 db26229..3c24424 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 a0bf569..7e65cd6 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 ce66744..06fcb95 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 9809de6..90f4040 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 => ({