in article/app/controllers/ArticleController.scala [104:143]
private def render(path: String, article: ArticlePage, blocks: Blocks)(implicit
request: RequestHeader,
): Future[Result] = {
val newsletter = newsletterService.getNewsletterForArticle(article)
val tier = ArticlePicker.getTier(article, path)
val isAmpSupported = article.article.content.shouldAmplify
val pageType: PageType = PageType(article, request, context)
request.getRequestFormat match {
case JsonFormat if request.forceDCR =>
Future.successful(common.renderJson(getDCRJson(article, blocks), article).as("application/json"))
case JsonFormat =>
Future.successful(common.renderJson(getJson(article), article))
case EmailFormat =>
Future.successful(common.renderEmail(ArticleEmailHtmlPage.html(article), article))
case HtmlFormat | AmpFormat if tier == PressedArticle =>
servePressedPage(path)
case AmpFormat if isAmpSupported =>
remoteRenderer.getAMPArticle(ws, article, blocks, pageType, newsletter)
case HtmlFormat | AmpFormat if tier == RemoteRender =>
remoteRenderer.getArticle(
ws,
article,
blocks,
pageType,
newsletter,
)
case HtmlFormat | AmpFormat =>
Future.successful(common.renderHtml(ArticleHtmlPage.html(article), article))
case AppsFormat =>
remoteRenderer.getAppsArticle(
ws,
article,
blocks,
pageType,
newsletter,
)
}
}