Skip to content

Commit

Permalink
Merge branch 'master' into maestro-pieces
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoknjas authored Dec 25, 2024
2 parents 8291187 + 9fb3011 commit 01f416f
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 48 deletions.
2 changes: 2 additions & 0 deletions modules/ublog/src/main/UblogPost.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ object UblogPost:
val intro: String
val image: Option[UblogImage]
val created: Recorded
val updated: Option[Recorded]
val lived: Option[Recorded]
def slug = UblogPost.slug(title)
def isLichess = created.by.is(UserId.lichess)
Expand All @@ -70,6 +71,7 @@ object UblogPost:
intro: String,
image: Option[UblogImage],
created: Recorded,
updated: Option[Recorded],
lived: Option[Recorded],
topics: List[UblogTopic]
) extends BasePost
Expand Down
13 changes: 8 additions & 5 deletions modules/ublog/src/main/ui/UblogUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,9 @@ final class UblogUi(helpers: Helpers, atomUi: AtomUi)(picfitUrl: lila.core.misc.

private def renderPost(post: UblogPost.PreviewPost, authorName: String) =
frag(
tag("id")(post.id),
tag("id")(s"$netBaseUrl${urlOfPost(post)}"),
tag("published")(post.lived.map(_.at).map(atomUi.atomDate)),
tag("updated")(post.updated.orElse(post.lived).map(_.at).map(atomUi.atomDate)),
link(
rel := "alternate",
tpe := "text/html",
Expand All @@ -361,11 +362,13 @@ final class UblogUi(helpers: Helpers, atomUi: AtomUi)(picfitUrl: lila.core.misc.
)
},
tag("content")(tpe := "html")(
thumbnail(post, _.Size.Large),
"<br>", // yes, scalatags encodes it.
post.intro
frag(
thumbnail(post, _.Size.Large),
br,
post.intro
).render // html as escaped string in xml
),
tag("tag")("media:thumbnail")(attr("url") := thumbnailUrl(post, _.Size.Large)),
tag("media:thumbnail")(attr("url") := thumbnailUrl(post, _.Size.Large)),
tag("author")(tag("name")(authorName))
)

Expand Down
Loading

0 comments on commit 01f416f

Please sign in to comment.