βββ β ββ β¦ ββ β βββ
Associated notes
This note is part of a series about how this blog is set up. See here for an overview.
Introduction
Other guides
- https://kanpov.github.io/articles/creating-blog-site-with-quartz4-obsidian
- https://zanca.dev/blog/quartz
- https://till-lieber.de/Anleitungen-quartz/
Basic Setup
1. Install Obsidian, GitHub Desktop & Git
(Reasons for chosen programs)
GitHub Desktop includes a git client, however for a number of reasons we need another separate git installation for the Obsidian git plugin. β https://github.com/desktop/desktop/issues/3801#issuecomment-357713357
2. GitHub Setup (Blog repository)
- Fork https://github.com/jackyzha0/quartz (name: GHUSERNAME.github.io)
- create new branch βupstreamβ (from v4, useful to compare changes that happen upstream which might require config changes)
- delete the folder βcontentβ and the file README.md (and
Build and Test
workflow) - follow https://quartz.jzhao.xyz/hosting#github-pages
- (optional) Instructions for use with a custom domain: https://quartz.jzhao.xyz/hosting#custom-domain
3. Initial Obsidian Settings
- Options β Appearance > Base color scheme β Dark
- Options β Files and links β Deleted files β Move to Obsidian trash (.trash folder)
- Options β Files and links β Detect all file extensions β enable
- Options β Files and links β Default location for new attachments β in subfolder under current folder β attachments
- Options β Files and links β Default location for new notes β In the folder specified below β private
- Options β Editor β Default editing mode β Source mode
- Options β Editor β Display β Readable line length β toggle off
- Options β Editor β Behavior β Spellcheck languages β Add
English
Create required folder structure
Minimal setup:
C:\users\USERNAME\Obsidian\VAULTNAME\
βββ .obsidian
β βββ ...
βββ .github
β βββ sync.yml
β βββ workflows
β βββ sync.yml
βββ private
β βββ .gitkeep
βββ public
β βββ index.md
βββ .gitignore
Contents of /.github/workflows/sync.yml
and /.github/sync.yml
:
zoylendt/zoylendt.github.io@v4:
- source: public/
dest: content/
deleteOrphaned: true
name: Sync Files
on:
push:
branches:
- main
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Run GitHub File Sync
uses: BetaHuhn/repo-file-sync-action@v1
with:
GH_PAT: ${{ secrets.GH_PAT }}
SKIP_PR: true
The file .gitignore
contains only one line:
.obsidian/workspace.json
(Explain .github files etc, original file add .gitignore retroactively)
- βSKIP_PR: trueβ β pushes directly to default branch, skips creating a pull request
- βCOMMIT_EACH_FILE: falseβ β commit multiple file changes a a single commit
- βmainβ instead of βmasterβ
(Optional) Suggested folder structure:
C:\users\USERNAME\Obsidian\VAULTNAME\
βββ .git
β βββ ...
βββ .obsidian
β βββ ...
βββ .github
β βββ sync.yml
β βββ workflows
β βββ sync.yml
βββ .trash
β βββ .gitkeep
βββ private
β βββ .gitkeep
βββ public
β βββ index.md
β βββ template.md
β βββ tags
β β βββ tag1.md
β βββ Topic1
β β βββ blogpage1.md
β β βββ attachments
β β βββ image.png
β βββ Topic2
β βββ blogpage2.md
βββ .gitignore
(Reasons for this structure)
Initialize Obsidian folder as git repo (using GitHub Desktop)
Now we need to initialize the Obsidian vault directory as a git repo. Using GitHub Desktop this works as follows:
- (Install GitHubDesktop and log in with your GitHub USERNAME)
- GitHub Desktop β βAdd an Existing Repository from your local driveβ β choose Obsidian folder β Click on blue βcreate a repositoryβ within red warning text
- Name: obsidian-backup
- other settings unchanged
- Path: (path of your Obsidian vault, named VAULTNAME)
- β βCreate repositoryβ
- β click the blue button βPublish repositoryβ
- β name: obsidian-backup
- β β[x] Keep this code privateβ β IMPORTANT! GitHub Desktop can be closed now. Itβs useful for resolving git issues if they occur.
Create PAT (Personal Access Token) and store it as a Repository Secret in your obsidian-backup-repo
-
Note: custom name, e.g. βsync contents to blogβ Expiration: No expiration Scope: full repo scope (see image: https://github.com/BetaHuhn/repo-file-sync-action/discussions/31 )
Take note of the generated PAT for the next step! It looks like this: ghp_xxxxxxxxxxxxxxxx
Open your private obsidian-backup repo on gitHub
Settings -> Security -> Secrets and variables -> Actions-> Secrets -> New repository secret
Name: GH_PAT Secret: (PAT generated in the previous step)
(Maybe better: use GH_INSTALLATION_TOKEN as described here: https://github.com/marketplace/actions/repo-file-sync-action#token )
Obsidian Git Plugin
After making sure that weβve installed Git and prepared the Obsidian vault as a git repo (with GitHub Desktop), we need to install and enable the Obsidian Git plugin:
- Options β Community Plugins β Turn on community plugins β Browse β βGit by Vinzent, (Denis Olehov)β β Install
- Options β Community Plugins β Installed Plugins β Git β enable (slide to right)
- Options β Community Plugins β Installed Plugins β Git β Options (kog)
β¦
- Backup β βPull updates on startupβ β enable
- Commit message β β{{hostname}} placeholder replacementβ β enter your hostname
- Commit message β βCommit message on manual backup/commitβ β βmanual backup: {{date}} from {{hostname}}, {{numFiles}} filesβ
- Automatic β βCommit message on auto backup/commitβ β βauto backup: {{date}} from {{hostname}}, {{numFiles}} filesβ
- Miscellaneous β βShow the count of modified files in the status barβ β enable
- Commit message β βList filenames affected by commit in the commit bodyβ β enable
- Automatic β βVault backup interval (minutes)β β 10
- Automatic β βAuto pull interval (minutes)β β 9
β¦
Customize you Quartz
config changes
- changes of layout
- make fat text stand out more
inspired by showcases
-
- different background
- βrecent notesβ & βexplorerβ only on startpage
-
https://www.chadly.net/ & https://notes.yxy.ninja/
- βlast updated atβ
- βHistoryβ β link to github
Working on multiple PCs
β¦
(add .obsidian/workspace.json)
to local .gitignore
) β done
Setup on new PC (Windows)
β see obsidian on multiple pc
βββ β ββ β¦ ββ β βββ