Skip to content

Repository files navigation

@quartz-plugins/canvas-page

Fork of @quartz-community/canvas-page — Hexo-compatible fork with _posts/ prefix stripping and canvas badge.

A page type plugin that renders JSON Canvas (.canvas) files as interactive, pannable and zoomable canvas pages. Supports the full JSON Canvas 1.0 spec, including text nodes with Markdown rendering, file nodes that link to other pages, link nodes for external URLs, group nodes for visual organization, and edges between nodes rendered as SVG paths with optional labels, arrow markers, and colors.

Hexo Compatibility

When using Quartz with a Hexo-style content directory (where content/ is symlinked to _posts/), Obsidian stores file paths in .canvas files with a _posts/ prefix (e.g., _posts/B_Code/汇编/X64内核结构体详解.md). Quartz slugs don't include this prefix, causing broken links.

This fork automatically strips the _posts/ prefix from canvas file node paths before generating links.

Installation

# Using Quartz CLI
npx quartz add plugin @quartz-plugins/canvas-page

# Or manual installation
npm install @quartz-plugins/canvas-page

Then add to your quartz.config.yaml:

plugins:
  pageType:
    - plugin: @quartz-plugins/canvas-page
      options:
        enableInteraction: true
        initialZoom: 1
        minZoom: 0.1
        maxZoom: 5

Changes from Upstream

Change Description
_posts/ prefix stripping Automatically strips _posts/ from Obsidian canvas file paths for Hexo compatibility
Canvas badge Floating "Canvas" badge indicator on canvas pages
Package scope @quartz-plugins instead of @quartz-community

License

MIT

About

JSON Canvas (Obsidian .canvas) page type plugin for Quartz v5 — Hexo-compatible fork with _posts/ prefix stripping

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages