| 25 | }; |
| 26 | |
| 27 | const registerPartials = (): void => { |
| 28 | if (!fs.existsSync(COMPONENTS_DIR)) { |
| 29 | return; |
| 30 | } |
| 31 | |
| 32 | const partialFiles = fs.readdirSync(COMPONENTS_DIR); |
| 33 | |
| 34 | for (const file of partialFiles) { |
| 35 | if (file.endsWith(".hbs")) { |
| 36 | const partialName = path.basename(file, ".hbs"); |
| 37 | const partialContent = fs.readFileSync( |
| 38 | path.join(COMPONENTS_DIR, file), |
| 39 | "utf8" |
| 40 | ); |
| 41 | |
| 42 | Handlebars.registerPartial(partialName, partialContent); |
| 43 | } |
| 44 | } |
| 45 | }; |
| 46 | |
| 47 | const getDummyValue = (varName: string): string => { |
| 48 | const lowercased = varName.toLowerCase(); |