API Keys
Turn a source into an unitied interface
Usage
Source API is a helper to load file-system based source files, it outputs numerous useful properties to integrate with other components, such as Page Tree.
The output strictly follows Page Conventions. During the process, your input source files will be parsed and form a virtual storage to avoid inconsistent behaviour between different OS.
Custom Source
Furthermore, you can write your source interface. The Source
object includes a files
property which has an array of virtual files.
Each virtual file must contain its file path and corresponding data.
Transformer
To perform custom file-system operations before processing the storage, you can add a transformer.
Root Directory
All files outside of the root directory will be ignored.
Base URL
As the loader
function also generate an URL for each page, you can override the default base URL.
Icons
Load the icon from the data of pages and meta files.
Last updated on