Class MarkdownFrontMatterLoaderTask
java.lang.Object
com.mohamnag.jstatic.plugins.front_matter_loader.MarkdownFrontMatterLoaderTask
- All Implemented Interfaces:
BuildTask
Loads each markdown data file and its front matter from configured path and adds it to
the
DataTree
as a DataPage
. Directories are represented as DataNode
but no additional data is added to them.
Front matter data are added as they are (key-value) to the DataPage
and the body
is is added under key "body".
The markdown in body, is preserved as-is and might be compiled down to HTML in template just like any other field by the means that template system provides.
All files with ".md" extension are considered to be front matter files with markdown body.
Some aspects of this plugin can be configured as described in FrontMatterLoaderConfig
.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
run
(BuildContext buildContext) If a plugin depends on config files in addition to the general config file of the application, like functionality extensions stored in files, it shall return these paths here.If a plugin depends on file input, it shall return list of its input paths to be watched for changes.
-
Field Details
-
DATA_KEY_BODY
- See Also:
-
-
Constructor Details
-
MarkdownFrontMatterLoaderTask
-
-
Method Details
-
run
-
underWatchInputPaths
Description copied from interface:BuildTask
If a plugin depends on file input, it shall return list of its input paths to be watched for changes. Paths can be either files or directories. In case of directories, only root path are necessary to be listed and if input path has subdirectories, they will be automatically watched.- Specified by:
underWatchInputPaths
in interfaceBuildTask
-
underWatchConfigPaths
Description copied from interface:BuildTask
If a plugin depends on config files in addition to the general config file of the application, like functionality extensions stored in files, it shall return these paths here. A change detected in these paths will result in recreation of the plugin.- Specified by:
underWatchConfigPaths
in interfaceBuildTask
-