Skip to content

Commit

Permalink
Fixing a problem with post generation
Browse files Browse the repository at this point in the history
  • Loading branch information
denisftw committed Mar 14, 2021
1 parent f9d463b commit b1f8d8f
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,17 @@ class PageGenerationService {
ZIO
.foreach(translations) { langBundle =>
blocking {
ZIO {
val langOutputDir = langBundle.siteDir.toFile
if (!langOutputDir.exists()) {
langOutputDir.mkdir()
}
postData.filter { obj =>
obj.get("type").contains("post")
} map { contentObj =>
generateSingleBlogFile(siteCommonData, contentObj, langOutputDir.toString, htmlTemplates.postTemplate,
langBundle)
}
val langOutputDir = langBundle.siteDir.toFile
if (!langOutputDir.exists()) {
langOutputDir.mkdir()
}
val onlyPosts = postData.filter(_.get("type").contains("post"))
ZIO.foreach(onlyPosts) { contentObj =>
generateSingleBlogFile(siteCommonData, contentObj, langOutputDir.toString, htmlTemplates.postTemplate,
langBundle)
}
}
}
.catchAll(th => ZIO.fail(GenerationError(th)))
.as(())
}

Expand Down

0 comments on commit b1f8d8f

Please sign in to comment.