This repository was archived by the owner on Jan 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Story Templating #88
Copy link
Copy link
Open
Description
Could client projects configure a template that is used when creating stories with the sba story command? This way they could provide their own format, with their own modifications. The current story template from story-config.js is shown below. Right now this is the only template that can be used and is not able to be modified by the client project.
render() {
return `
const ${this.contentPathIdentifier} = "${this.contentPath}";
export const ${this.identifier} = () => ({
template: async () => fetchFromAEM(${this.contentPathIdentifier})
});
${this.identifier}.story = {
name: '${this.prettyName}',
parameters: { }
};
`;
}I think the idea would be to look at the default export of .storybook/story.template.js for a string literal and pass it the same data we are passing the above string literal. If no such file exists then we fall back to the above 'default' template.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels