Skip to content

Commit

Permalink
Unbox title for blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Aug 31, 2023
1 parent 4b9b9d4 commit 8a58fcc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/views/blog/show.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import controllers.routes
object show:

def apply(post: BlogPost)(using ctx: PageContext, prismic: lila.blog.BlogApi.Context) =
val postTitle = ~post.title
views.html.base.layout(
title = s"${post.title} | Blog",
title = s"$postTitle | Blog",
moreJs = jsModule("expandText"),
openGraph = lila.app.ui
.OpenGraph(
`type` = "article",
image = post.getImage("blog.image", "main").map(_.url),
title = ~post.title,
title = postTitle,
url = s"$netBaseUrl${routes.Blog.show(post.id, post.slug).url}",
description = post.shortlede
)
Expand All @@ -27,7 +28,7 @@ object show:
main(cls := "page-menu page-small")(
bits.menu(none, "lichess".some),
div(cls := s"blog page-menu__content box post force-ltr ${~post.getText("blog.cssClasses")}")(
h1(cls := "box__top")(post.title),
h1(cls := "box__top")(postTitle),
bits.metas(post),
post.getImage("blog.image", "main").map { img =>
div(cls := "illustration")(st.img(src := img.url))
Expand Down

0 comments on commit 8a58fcc

Please sign in to comment.