MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / registerPartials

Function registerPartials

apps/api/src/templates/email/build.ts:40–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38};
39
40const registerPartials = (): void => {
41 if (!fs.existsSync(COMPONENTS_DIR)) {
42 return;
43 }
44
45 const partialFiles = fs.readdirSync(COMPONENTS_DIR);
46
47 for (const file of partialFiles) {
48 if (file.endsWith(".hbs")) {
49 const partialName = path.basename(file, ".hbs");
50 const partialContent = fs.readFileSync(
51 path.join(COMPONENTS_DIR, file),
52 "utf8"
53 );
54
55 Handlebars.registerPartial(partialName, partialContent);
56 }
57 }
58};
59
60const findTemplates = (dir: string, fileList: string[] = []): string[] => {
61 const files = fs.readdirSync(dir);

Callers 2

buildAllFunction · 0.70
watchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected