diff --git a/views/feed.templ b/views/feed.templ
index 64716e6..9f79e57 100644
--- a/views/feed.templ
+++ b/views/feed.templ
@@ -74,26 +74,37 @@ templ Feed(isAdmin bool, movies types.Movies, nextPage int, query string) {
data-movie={ strconv.Itoa(movie.ID) }
data-year={ movie.WatchedAt.Format("2006") }
data-month={ movie.WatchedAt.Format("January") }
- _="init if my @data-year is not equal to @data-year of previous
- then
- make an
- put it before me
- then
- make an
- put the @data-year into its textContent
- put it into the previous
- end
+ _="
+init if my @data-year is not really equal to @data-year of previous then
+ set dataYear to my @data-year
- init if my @data-month is not equal to @data-month of previous
- then
- make an
- put it before me
- then
- make an
- put the @data-month into its textContent
- put it at the end of the previous
- end
- "
+ if #{dataYear} does not exist then
+ make an
+ put my @data-year into its @id
+ put it before me
+ then
+ make an
+ put the @data-year into its textContent
+ put it into the previous
+ end
+ end
+
+init if my @data-month is not really equal to @data-month of previous then
+ set y to my @data-year
+ set m to my @data-month
+ set ym to `${y}-${m}`
+
+ if #{ym} does not exist then
+ make an
+ put `${ym}` into its @id
+ put it before me
+ then
+ make an
+ put the @data-month into its textContent
+ put it at the end of the previous
+ end
+end
+"
>