Lays out the "journal" tab of the index page: it ranks the loaded dumps by
hotScore, gives each a tile size in a 4-column mosaic, and cuts the
mosaic into blocks. JournalFeed renders the blocks.
Sorts dumps by hotScore and lays them out as a mosaic whose rows
all close, cut into blocks. JournalFeed calls it on every change of the
feed.
Checks whether dump has a non-blank note, which JournalCard shows as a
pull-quote when the dump has no image.
Checks whether dump has an image to show: an uploaded thumbnail, an image,
video or audio file, or a link preview's thumbnail. Only such dumps get the
large tiles, and JournalCard shows them as image tiles.
Returned by composeJournal. JournalFeed renders each block as its
own grid, with a rule between two blocks.
-
entries: JournalEntry[]
In reading order.
-
key: string
The id of the block's first dump, stable as more pages load.
The grid span of a tile, which JournalCard turns into a CSS class. A
feature spans 2×2 cells, a wide 2×1, a tall 1×2 and a square 1×1.
Whether the tile shows an image, a quote or text depends on the dump alone.
Usage
import * as mod from "src/utils/feed/journalLayout.ts";