Class StoryblokLoaderTask
- All Implemented Interfaces:
BuildTask
StoryblokLoaderConfig.KEY_TARGET_NODE.
To determine the path of the page, we use the full slug of the page and will append `/index` to it if it is not
already containing it. This is in sync with what Storyblok's UI is expecting from the relation between slug and
paths. This means if you want to put a page on root of its directory you either define it as such in the editor or
use the slug index for it if not possible.
If you are using links to internal stories, you need to get the id in your link object and lookup the
URL from the root level links list of the full data object that is put under root node. If using
Hamcrest templates, probably having a helper to do this would be the easiest solution. Something between the lines
of:
Handlebars.registerHelper(
'resolveStoryblokLinkUrl', function (page, link) {
let storyblokData = page.getRecursiveData('storyblok').orElse(undefined);
if (storyblokData) {
for (const key in storyblokData.links) {
let linkData = storyblokData.links[key];
if (linkData.uuid === link.id) {
return linkData.url;
}
}
}
return "";
});
See Storyblok documentation for
details on how links work.
See StoryblokLoaderConfig for configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun(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.
-
Constructor Details
-
Method Details
-
run
-
underWatchInputPaths
Description copied from interface:BuildTaskIf 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:
underWatchInputPathsin interfaceBuildTask
-
underWatchConfigPaths
Description copied from interface:BuildTaskIf 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:
underWatchConfigPathsin interfaceBuildTask
-