1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2024-11-16 21:27:30 +00:00
bibliogram/src/site/pug/includes/timeline_page.pug
2020-06-22 01:03:41 +12:00

17 lines
832 B
Plaintext

//- Needs page, pageIndex
mixin timeline_page(page, pageIndex)
section.timeline-page
- const pageNumber = pageIndex + 1
if pageNumber > 1
header.page-number(id=`page-${pageNumber}`)
span.number Page #{pageNumber}
.timeline-inner(class=`${settings.timeline_columns}-columns`)
- const suggestedSize = 260 //- from css :(
each image in page
- const thumbnail = image.getSuggestedThumbnailP(suggestedSize) //- use this as the src in case there are problems with srcset
a(href=`/p/${image.data.shortcode}` data-shortcode=image.data.shortcode).sized-link
//- using config_width twice because the proxy makes it square
img(src=thumbnail.src alt=image.getAlt() width=thumbnail.config_width height=thumbnail.config_width srcset=image.getThumbnailSrcsetP() sizes=image.getThumbnailSizes()).sized-image