processFile method

Future<void> processFile(
  1. FileCacheable fileCacheable
)

Implementation

Future<void> processFile(FileCacheable fileCacheable) async {
  final sourceFileName = path.basenameWithoutExtension(fileCacheable.file.path);
  final destFileName = "${path.join(destinationDir.absolute.path, sourceFileName)}.html";

  final compiledContent = await processTemplate(fileCacheable.content, fileCacheable.metadata);

  final destFile = File(destFileName);
  if (!await destFile.exists()) {
    await destFile.create(recursive: true);
  }

  await destFile.writeAsString(compiledContent);
}