ssg-api
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -8,2 +8,8 @@ # Change Log | ||
## [1.4.1] - 2023-01-22 | ||
### Added | ||
- Overridable method to allow processing a content file. | ||
## [1.4.0] - 2023-01-22 | ||
@@ -10,0 +16,0 @@ |
@@ -44,2 +44,3 @@ import { SsgStep } from "../SsgStep"; | ||
protected processFile(context: C, filePath: string, contentsConfig: ContentStepConfig, fileCount: number): Promise<number>; | ||
protected shouldProcess(context: C): boolean; | ||
} |
@@ -49,2 +49,12 @@ import { promise as glob } from "glob-promise"; | ||
context.outputFile = contentsConfig.getOutputFile(context); | ||
if (this.shouldProcess(context)) { | ||
for (const replacement of contentsConfig.replacements) { | ||
context.outputFile = await replacement.execute(context); | ||
} | ||
fileCount++; | ||
await this.output(context, context.outputFile); | ||
} | ||
return fileCount; | ||
} | ||
shouldProcess(context) { | ||
let process; | ||
@@ -62,11 +72,4 @@ const exists = fs.existsSync(context.outputFile.name); | ||
} | ||
if (process) { | ||
for (const replacement of contentsConfig.replacements) { | ||
context.outputFile = await replacement.execute(context); | ||
} | ||
fileCount++; | ||
await this.output(context, context.outputFile); | ||
} | ||
return fileCount; | ||
return process; | ||
} | ||
} |
@@ -5,3 +5,3 @@ { | ||
"author": "Jérôme Beau", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Static Site Generation TypeScript API", | ||
@@ -8,0 +8,0 @@ "exports": "./dist/src/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
918453
3016