mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2025-12-16 11:08:49 +00:00
Create post viewer
This commit is contained in:
@@ -8,7 +8,8 @@ mixin timeline_page(page, pageIndex)
|
||||
span.number Page #{pageNumber}
|
||||
|
||||
.timeline-inner
|
||||
- const suggestedSize = 300
|
||||
- const suggestedSize = 260 //- from css :(
|
||||
each image in page
|
||||
- const thumbnail = image.getSuggestedThumbnail(suggestedSize) //- use this as the src in case there are problems with srcset
|
||||
img(src=image.getProxy(thumbnail.src) alt=image.getAlt() width=thumbnail.config_width height=thumbnail.config_height srcset=image.getSrcset() sizes=`${suggestedSize}px`).image
|
||||
a(href=`/p/${image.data.shortcode}`).sized-link
|
||||
img(src=thumbnail.src alt=image.getAlt() width=thumbnail.config_width height=thumbnail.config_height srcset=image.getSrcset() sizes=image.getSizes()).sized-image
|
||||
|
||||
20
src/site/pug/post.pug
Normal file
20
src/site/pug/post.pug
Normal file
@@ -0,0 +1,20 @@
|
||||
- const numberFormat = new Intl.NumberFormat().format
|
||||
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
meta(charset="utf-8")
|
||||
meta(name="viewport" content="width=device-width, initial-scale=1")
|
||||
title= `${post.getIntroduction()} | Bibliogram`
|
||||
link(rel="stylesheet" type="text/css" href="/static/css/main.css")
|
||||
script(src="/static/js/pagination.js" type="module")
|
||||
body.post-page
|
||||
main.post-page-divider
|
||||
section.description-section
|
||||
header.user-header
|
||||
img(src=post.proxyOwnerProfilePicture width=150 height=150 alt="").pfp
|
||||
a.name(href=`/u/${post.extendedOwner.username}`)= `${post.extendedOwner.full_name} (@${post.extendedOwner.username})`
|
||||
p.description= post.getCaption()
|
||||
section.images-gallery
|
||||
for image in post.getChildren()
|
||||
img(src=image.proxyDisplayURL alt=image.getAlt() width=image.data.dimensions.width height=image.data.dimensions.height).sized-image
|
||||
@@ -37,6 +37,7 @@ html
|
||||
| followed by
|
||||
div.links
|
||||
a(rel="alternate" type="application/rss+xml" href=`/u/${user.data.username}/rss.xml`) RSS
|
||||
a(rel="noreferrer noopener" href=`https://www.instagram.com/${user.data.username}`) instagram.com
|
||||
|
||||
main#timeline.timeline
|
||||
each page, pageIndex in user.timeline.pages
|
||||
|
||||
Reference in New Issue
Block a user