Skip to content

Commit

Permalink
feat: STRF-11523 Add the ability to use Handlebar Partial Blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
jairo-bc committed Mar 29, 2024
1 parent 90543ec commit 4908655
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 2,250 deletions.
5 changes: 4 additions & 1 deletion lib/template-assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const dynamicComponentRegex = /\{\{\s*?dynamicComponent\s*(?:'|")([_|\-|a-zA-Z0-
const includeRegex = /{{2}>\s*([_|\-|a-zA-Z0-9/]+)[^{]*?}{2}/g;
const pathStringRegex = /^["'].+["']$/;
const packageMarker = 'external/';
const partialBlock = '@partial-block';

/**
* indicates if a template source is a node modules dependency
Expand Down Expand Up @@ -169,7 +170,9 @@ function getTemplatePaths(templatesFolder, templates, options, callback) {
while (match !== null) {
[, partialPath] = match;
if (!templatePaths.includes(partialPath)) {
matches.push(partialPath);
if (partialPath !== partialBlock) {
matches.push(partialPath);
}
}
match = partialRegex.exec(content);
}
Expand Down
Loading

0 comments on commit 4908655

Please sign in to comment.