1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2025-12-16 11:08:49 +00:00
This commit is contained in:
Cadence Fish
2020-01-15 03:38:33 +13:00
parent b5f163891c
commit 30b45c2573
17 changed files with 157 additions and 26 deletions

View File

@@ -1,5 +0,0 @@
mixin image(url)
-
let params = new URLSearchParams()
params.set("url", url)
img(src="/imageproxy?"+params.toString())&attributes(attributes)

View File

@@ -1,15 +1,14 @@
//- Needs page, pageIndex
include image.pug
mixin timeline_page(page, pageIndex)
- const pageNumber = pageIndex + 1
if pageNumber > 1
.page-number(id=`page-${pageNumber}`)
span.number Page #{pageNumber}
section.timeline-page
- const pageNumber = pageIndex + 1
if pageNumber > 1
header.page-number(id=`page-${pageNumber}`)
span.number Page #{pageNumber}
.timeline-inner
- const suggestedSize = 300
each image in page
- const thumbnail = image.getSuggestedThumbnail(suggestedSize) //- use this as the src in case there are problems with srcset
+image(thumbnail.src)(alt=image.getAlt() width=thumbnail.config_width height=thumbnail.config_height srcset=image.getSrcset() sizes=`${suggestedSize}px`).image
.timeline-inner
- const suggestedSize = 300
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

View File

@@ -16,10 +16,10 @@ html
.main-divider
header.profile-overview
.profile-sticky
+image(user.data.profile_pic_url)(width="150px" height="150px").pfp
img(src=user.proxyProfilePicture width="150px" height="150px" alt=`${user.data.full_name}'s profile picture.`).pfp
//-
Instagram only uses the above URL, but an HD version is also available:
+image(user.data.profile_pic_url_hd)
Instagram only uses the above URL, but an HD version is also available.
The alt text is pathetic, I know. I don't have much to work with.
h1.full-name= user.data.full_name
h2.username= `@${user.data.username}`
p.bio= user.data.biography
@@ -35,6 +35,8 @@ html
span(data-numberformat=user.followedBy).count #{numberFormat(user.followedBy)}
|
| followed by
div.links
a(rel="alternate" type="application/rss+xml" href=`/u/${user.data.username}/rss.xml`) RSS
main#timeline.timeline
each page, pageIndex in user.timeline.pages