This script dynamically loads and displays a hierarchical list of subpages in Wiki.js (version 2.x). It utilizes the built-in GraphQL API (pages.search for subpaths, pages.list for root-level) to fetch pages and builds a nested tree view up to a specified depth.
The script can be included in two ways:
- Globally via Administration → Theme → Head HTML Injection