From 92d18b1ee5e4dfcba10d03f79210e1f15bac0b74 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Sun, 18 Jul 2021 15:19:58 -0400 Subject: [PATCH] more docs + link fixing --- .github/workflows/deploy.yaml | 2 +- content/moc/directory.md | 13 ++--- content/notes/config.md | 5 ++ content/notes/editing.md | 66 +++++++++++++++++++++++ content/notes/hosting.md | 5 ++ content/notes/obsidian.md | 9 ++++ content/notes/setup.md | 25 ++++++++- content/notes/troubleshooting.md | 2 +- layouts/_default/_markup/render-link.html | 7 ++- layouts/partials/head.html | 7 +-- 10 files changed, 125 insertions(+), 16 deletions(-) create mode 100644 content/notes/editing.md diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 403379e..ba14825 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -20,7 +20,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.79.1' + hugo-version: '0.82.0' extended: true - name: Build diff --git a/content/moc/directory.md b/content/moc/directory.md index 118c28f..7726de8 100644 --- a/content/moc/directory.md +++ b/content/moc/directory.md @@ -2,15 +2,16 @@ 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 -📚 [setup](notes/setup.md) - -## Configuration -[config](notes/config.md) +- 📚 [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) ## Troubleshooting -[troubleshooting](notes/troubleshooting.md) \ No newline at end of file +- 🚧 [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/config.md b/content/notes/config.md index d8b3491..89e7d8d 100644 --- a/content/notes/config.md +++ b/content/notes/config.md @@ -1,3 +1,8 @@ --- title: "Configuration" --- + +## Styling +## Layouts +### Home Page +### Partials \ No newline at end of file diff --git a/content/notes/editing.md b/content/notes/editing.md new file mode 100644 index 0000000..3264d4b --- /dev/null +++ b/content/notes/editing.md @@ -0,0 +1,66 @@ +--- +title: "Editing Content in Quartz" +--- + +## Editing +Quartz runs on top of [Hugo](https://gohugo.io/) so all notes are written in [Markdown](https://www.markdownguide.org/getting-started/). + +**All content in your garden can found in the `/content` folder.** To make edits, you can open any of the files and make changes directly and save it. You can organize content into any folder you'd like. + +To create a link, just create a normal link using Markdown pointing to the document in question. Please note that **all links should be relative to the root `/content` path**. + +```markdown +For example, I want to link this current document to `config.md`. +[A link to the config page](config.md) +``` + +### 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)** + +Of course, all the files are in Markdown so you could just use your favourite text editor of choice, I'm not going to stop you! + +## Previewing Changes +This step is purely optional and mostly for those who want to see the published version of their digital garden locally before opening it up to the internet. For those who like to live life more on the edge, viewing the garden through Obsidian gets you pretty close to the real thing. + +### Installing Hugo +Hugo is the static site generator that powers Quartz. If you'd like to preview your site locally, [install Hugo](https://gohugo.io/getting-started/installing/). + +``` +# Navigate to your local Quartz folder +$ cd + +# Start local server +$ hugo server + +# View your site in a browser at http://localhost:1313/ +``` + +### Install `hugo-obsidian` +This step is **doubly optional** and only applies to those who want to see their Interactive Graph and backlinks locally while previewing changes on the site. + +Ensure you have Go (>= 1.16) installed. + +```shell +# Clone the Repository +$ git clone https://github.com/jackyzha0/hugo-obsidian.git + +# Install and link `hugo-obsidian` locally +$ go install . + +# Navigate to your local Quartz folder +$ cd + +# Scrape all links in your Quartz folder and generate info for Quartz +$ hugo-obsidian -input=content -output=data +``` + +Afterwards, start the Hugo server as shown above and your local backlinks and interactive graph should be populated! + +## Publishing Changes +Now that you know the basics of managing your digital garden using Quartz, you can publish it to the internet! + +🌍 [Hosting Quartz online!](notes/hosting.md) + +Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). \ No newline at end of file diff --git a/content/notes/hosting.md b/content/notes/hosting.md index 7ab678a..18717f8 100644 --- a/content/notes/hosting.md +++ b/content/notes/hosting.md @@ -2,8 +2,13 @@ title: "Deploying to GitHub Pages" --- +## GitHub Pages + +## Custom subdomain Change `baseURL` in `/config.toml` ```toml baseURL = "https://quartz.jzhao.xyz/" ``` + +Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). \ No newline at end of file diff --git a/content/notes/obsidian.md b/content/notes/obsidian.md index da9cd10..bd4eb02 100644 --- a/content/notes/obsidian.md +++ b/content/notes/obsidian.md @@ -1,3 +1,12 @@ --- title: "Obsidian Vault Integration" --- + +Obsidian is the preferred way to use Quartz. You can either create a new Obsidian Vault or link one that your already have. + +## New Vault +If you don't have an existing Vault, download + +## Linking an existing Vault + +![](/notes/images/obsidian-settings.png) \ No newline at end of file diff --git a/content/notes/setup.md b/content/notes/setup.md index 6f7bdc2..2cd463d 100644 --- a/content/notes/setup.md +++ b/content/notes/setup.md @@ -2,7 +2,28 @@ title: "Setup" --- -![](/notes/images/obsidian-settings.png) +## Making your own Quartz +Setting up Quartz requires a basic understanding of `git`. If you are unfamiliar, [this resource](https://resources.nwplus.io/2-beginner/how-to-git-github.html) is a great place to start! +### Forking +> A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project. -Having problems? [troubleshooting](notes/troubleshooting.md) \ No newline at end of file +Navigate to the GitHub repository for the Quartz project: + +📁 [Quartz Repository](https://github.com/jackyzha0/quartz) + +Then, Fork the repository into your own GitHub account. If you don't have an account, you can make on for free [here](https://github.com/join). More details about forking a repo can be found on [GitHub's documentation](https://docs.github.com/en/get-started/quickstart/fork-a-repo). + +### Cloning +After you've made a fork of the repository, you need to download the files locally onto your machine. Ensure you have `git`, then type the following command replacing `YOUR-USERNAME` with your GitHub username. + +```shell +$ git clone https://github.com/YOUR-USERNAME/quartz +``` + +## Editing +Great! Now you have everything you need to start editing and growing your digital garden. If you're ready to start writing content already, check out the recommended flow for editing notes in Quartz. + +✏️ [Editing Notes in Quartz](notes/editing.md) + +Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md). \ No newline at end of file diff --git a/content/notes/troubleshooting.md b/content/notes/troubleshooting.md index cd296d6..8a986b1 100644 --- a/content/notes/troubleshooting.md +++ b/content/notes/troubleshooting.md @@ -1,3 +1,3 @@ --- -title: "troubleshooting" +title: "Troubleshooting and FAQ" --- diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 10856fa..0288029 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,2 +1,7 @@ {{$trimmed := strings.TrimSuffix ".md" (.Destination | safeURL)}} -{{ .Text | safeHTML }} \ No newline at end of file +{{$external := strings.HasPrefix $trimmed "http" }} +{{ if $external }} +{{ .Text | safeHTML }} +{{else}} +{{ .Text | safeHTML }} +{{end}} \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f7f6ae0..e53ebe1 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,8 +1,4 @@ - - - {{ template "_internal/google_analytics.html" . }} - @@ -21,4 +17,5 @@ {{end}} {{end}} - \ No newline at end of file + +{{ template "_internal/google_analytics.html" . }} \ No newline at end of file