This script dynamically loads and displays a hierarchical list of subpages for the current page in Wiki.js (version 2.x). It utilizes the built-in GraphQL API to fetch child pages and builds a nested tree view up to a specified depth.
The script is especially useful for wikis with structured page hierarchies and helps users navigate subpages more easily.
The script can be included in two ways:
- Globally by the administrator