quarto-obsidian-template
Template for maintaining notes as an Obsidian vault rendered as a Quarto website. This repo is mirrored at https://gitlab.com/rmgpanw/quarto-obsidian-template
Quarto-Obsidian Template
A template for maintaining notes as an Obsidian vault and rendering them as a Quarto website. Includes wikilinks, citations, an interactive graph, dark mode, and deployment workflows for GitHub Pages and GitLab Pages.
The included demo notes showcase template features. Delete them and add your own.
Prerequisites
Setup
- Click Use this template on GitHub to create your own repository.
- Clone your new repository:
git clone https://github.com/<your-username>/<your-repo>.git
cd <your-repo>
- Update
_quarto.ymlto point to your repository:repo-url- enables "View source" links on each page- The navbar icon
hrefunderright:- links the repo icon in the navbar - If hosting on GitLab instead of GitHub, change the icon from
githubtogitlab
With devcontainer (recommended): Open in VS Code and reopen in container when prompted.
Locally: Install Quarto, then:
quarto preview
The preview server runs on port 4200.
Adding a new note
In Obsidian: Create a new note (it will be placed in notes/ automatically), then insert the template via the command palette: Templates: Insert template and select Note.
Manually: Copy notes/_template.md to notes/your-note-name.md.
Then:
- Write the title as a
# heading(this becomes the page title on the website). - Fill in the YAML header (date, tags).
- Write the note content using standard Pandoc markdown.
- Add citations with
@citekeysyntax, referencing entries inreferences.bib.
New notes are automatically picked up by the listing page, with no manual updates required.
Tip: If you need executable code chunks (R, Python, etc.), use the
.qmdextension instead of.md. Both extensions are supported throughout the template.
Removing demo notes
Delete the two demo notes and their references:
rm notes/hello-world.md notes/demo-features.md
You may also want to replace the dummy entries in references.bib with your own.
Features
- Listing page - auto-lists all notes with tag/category filtering
- Dark mode - toggle between light (Cosmo) and dark (Darkly) themes
- Wikilinks - Obsidian-style
[[wikilinks]]are converted to standard links at render time byscripts/wikilinks.lua. The alias syntax[[target|display text]]is also supported - Citations - Pandoc
@citekeysyntax with Vancouver style viavancouver.csl - Interactive graph - D3.js force-directed graph showing note connections and tags
- Source links - each rendered page links back to its source file on GitHub/GitLab
- Tags - use Obsidian-native
tagsin YAML front matter; the Lua filter automatically converts them to Quarto categories for the listing page
Obsidian setup
- Open the repository folder as a vault in Obsidian.
- Notes use
.mdby default, so Obsidian will recognise them natively. - New notes are automatically created in
notes/. Use Templates: Insert template (command palette) to apply the Note template. - To set your own default author name, edit
_templates/Note.mdand replace"Your Name"with your name. - If you create
.qmdnotes, install the qmd-as-md community plugin and enable Settings > Files & Links > Detect all file extensions.
Syncing across devices
To access your vault on iOS (iPhone/iPad), clone or place the repository folder inside your iCloud Drive (e.g. ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/). The Obsidian mobile app will detect it automatically. Changes sync both ways via iCloud.
Foam / VS Code / Positron setup
Foam is a VS Code extension that provides Obsidian-like features (graph view, backlinks, wikilink navigation) inside VS Code or Positron.
- Install the Foam extension.
- Foam natively supports
[[wikilinks]]in.mdfiles, which is the default for this template. - Note: Foam does not resolve wikilinks in
.qmdfiles. If you need executable code chunks, consider keeping the note as.mdand renaming to.qmdonly when you need to render it with code execution.
The devcontainer already includes useful VS Code extensions (Quarto, Markdown All in One, Code Spell Checker).
PDFs
Key papers can be stored in pdfs/ for co-location. The main reference library is managed externally via Zotero and BetterBibTeX, which exports to references.bib.
Deployment
quarto render
This produces the site in _output/.
GitHub Pages
A GitHub Actions workflow (.github/workflows/deploy.yml) automatically builds and deploys to GitHub Pages on push to main. Enable GitHub Pages in your repository settings and set the source to the gh-pages branch. Each deployment uses a force orphan push, so the gh-pages branch never accumulates history.
GitLab Pages
A GitLab CI configuration (.gitlab-ci.yml) is also included. It renders the site and deploys to GitLab Pages on push to the default branch. No additional configuration is needed beyond enabling Pages in your GitLab project settings. GitLab Pages uses build artifacts rather than a branch, so there is no history accumulation.
GitLab mirroring
A GitHub Actions workflow (.github/workflows/mirror-gitlab.yml) automatically pushes all branches and tags to a GitLab mirror on every push. To set this up:
- Create a GitLab project with the same name.
- Create a GitLab Personal Access Token with
write_repositoryscope. - Add it as a GitHub Actions secret named
GITLAB_TOKEN.
How to Install
- Download the template file from GitHub
- Move it anywhere in your vault
- Open it in Obsidian — done!
Stats
Stars
0
Forks
0
Last updated 5mo ago
Categories