Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sidecar Jigsaw

Statamic Sidecar driver for Jigsaw. Edit flat docs pages under source/docs/ in the Control Panel while keeping hierarchy in navigation.php.

Installation

composer require statamic/cms tightenco/jigsaw statamic/sidecar-jigsaw
php please sidecar:install jigsaw

Or add the collection manually in config/statamic/sidecar.php:

'collections' => [
    'docs' => [
        'driver' => 'jigsaw',
        'directory' => base_path('source/docs'),
        // 'navigation' => base_path('navigation.php'),
        // 'url_prefix' => 'docs',
        // 'site_url' => 'http://localhost:8000',
        // 'preview_url' => 'http://localhost:8000/docs/{slug}',
    ],
],

Meant for the Jigsaw docs template layout: markdown files in source/docs/ plus a root navigation.php.

What it does

  • Registers a docs collection pointed at your Jigsaw docs directory
  • Enables Tree mode in the CP for drag-and-drop nesting/order
  • Keeps pages flat on disk (source/docs/{slug}.md) — URLs stay docs/{slug}
  • Rewrites navigation.php when the structure tree changes
  • Seeds the CP tree from navigation.php on first boot (when no tree file exists yet)
  • Preserves external / manual nav links that aren't collection entries
  • Ensures new pages get extends + section front matter so Jigsaw still builds
  • Visit URL via configurable site_url + url_prefix
  • Live Preview via !/sidecar/jigsaw/live-preview (WIP token rendering)

Config keys

Key Default Purpose
directory base_path('source/docs') Markdown pages
navigation base_path('navigation.php') Sidebar source of truth
url_prefix docs URL segment written into nav
site_url app url('/') Base for Visit URL
preview_url action live-preview route Override Live Preview target
title driver title Collection title override
blueprint driver blueprint Existing blueprint handle

Out of scope (v1)

  • Blog collections (source/_posts/)
  • Nested folder layouts
  • Auto-running jigsaw build on save
  • Full Blade layout/extends rendering in Live Preview (markdown body + nav only)

License

MIT

About

Statamic Sidecar adapter for Jigsaw

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages