bibliogram/src/site/pug/user.pug

64 lines
2.3 KiB
Plaintext

//- Needs user, url, constants
include includes/timeline_page.pug
include includes/next_page_button.pug
include includes/display_structured
- const numberFormat = new Intl.NumberFormat().format
doctype html
html
head
if user.data.full_name
title= `${user.data.full_name} (@${user.data.username}) | Bibliogram`
else
title= `@${user.data.username} | Bibliogram`
include includes/head
script(src="/static/js/pagination.js" type="module")
body
.main-divider
header.profile-overview
.profile-sticky
img(src=user.proxyProfilePicture width="150px" height="150px" alt=`${user.data.full_name || user.data.username}'s profile picture.`).pfp
//-
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.
if user.data.full_name
h1.full-name= user.data.full_name
h2.username= `@${user.data.username}`
else
h1.full-name= `@${user.data.username}`
if !user.fromReel
p.structured-text.bio
- const bio = user.getStructuredBio()
if bio
+display_structured(bio)
if user.data.external_url
p.website
a(href=user.data.external_url)= user.data.external_url
div.profile-counter #[span(data-numberformat=user.posts).count #{numberFormat(user.posts)}] posts
div.profile-counter #[span(data-numberformat=user.following).count #{numberFormat(user.following)}] following
div.profile-counter #[span(data-numberformat=user.followedBy).count #{numberFormat(user.followedBy)}] followed by
div.links
if constants.settings.rss_enabled
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
- const hasPosts = !user.data.is_private && user.timeline.pages.length && user.timeline.pages[0].length
main(class=hasPosts ? "" : "no-posts")#timeline.timeline
if !user.data.is_private
if hasPosts
each page, pageIndex in user.timeline.pages
+timeline_page(page, pageIndex)
+next_page_button(user, url)
else
div
div.page-number
span.number No posts.
else
div
div.page-number
span.number Profile is private.