2020-05-05 14:14:11 +00:00
|
|
|
//- Needs user, followerCountsAvailable, url, constants, settings
|
2020-02-01 03:15:12 +00:00
|
|
|
|
2020-01-12 12:50:21 +00:00
|
|
|
include includes/timeline_page.pug
|
2020-01-12 15:39:50 +00:00
|
|
|
include includes/next_page_button.pug
|
2020-02-03 14:30:19 +00:00
|
|
|
include includes/display_structured
|
2020-02-18 00:39:20 +00:00
|
|
|
include includes/feed_link
|
2020-01-12 12:50:21 +00:00
|
|
|
|
|
|
|
- const numberFormat = new Intl.NumberFormat().format
|
|
|
|
|
|
|
|
doctype html
|
|
|
|
html
|
|
|
|
head
|
2020-02-02 13:24:14 +00:00
|
|
|
if user.data.full_name
|
|
|
|
title= `${user.data.full_name} (@${user.data.username}) | Bibliogram`
|
|
|
|
else
|
|
|
|
title= `@${user.data.username} | Bibliogram`
|
2020-02-05 06:05:18 +00:00
|
|
|
include includes/head
|
2020-05-05 14:14:11 +00:00
|
|
|
if settings.spa
|
|
|
|
script(src=getStaticURL("html", "/static/js/post_overlay.js") type="module")
|
|
|
|
else
|
|
|
|
script(src=getStaticURL("html", "/static/js/pagination.js") type="module")
|
2020-04-22 11:59:45 +00:00
|
|
|
meta(property="og:url" content=`${constants.website_origin}/u/${user.data.username}`)
|
2020-03-04 12:12:24 +00:00
|
|
|
meta(property="og:type" content="profile")
|
|
|
|
meta(property="og:title" content=(user.data.full_name || user.data.username))
|
|
|
|
if user.data.biography
|
|
|
|
meta(property="og:description" content=user.data.biography)
|
2020-04-22 11:59:45 +00:00
|
|
|
meta(property="og:image" content=`${constants.website_origin}${user.proxyProfilePicture}`)
|
2020-03-04 12:12:24 +00:00
|
|
|
meta(property="og:image:width" content=150)
|
|
|
|
meta(property="og:image:height" content=150)
|
|
|
|
meta(property="og:image:type" content="image/jpeg")
|
|
|
|
meta(property="og:site_name" content="Bibliogram")
|
|
|
|
|
2020-01-12 12:50:21 +00:00
|
|
|
body
|
2020-05-05 15:35:18 +00:00
|
|
|
nav(class=(settings.display_top_nav ? "always-displayed" : "")).top-nav
|
|
|
|
//- Alt text guidelines from https://axesslab.com/alt-texts/
|
|
|
|
a(href="/").nav-icon-link
|
|
|
|
img(src="/static/img/logo-circle-min.svg" alt="Bibliogram").logo
|
2020-05-29 08:46:45 +00:00
|
|
|
a(href=settingsReferrer).nav-icon-link
|
2020-05-05 15:35:18 +00:00
|
|
|
img(src="/static/img/settings.svg" alt="Settings").settings
|
2020-01-12 12:50:21 +00:00
|
|
|
.main-divider
|
|
|
|
header.profile-overview
|
|
|
|
.profile-sticky
|
2020-05-05 15:35:18 +00:00
|
|
|
section
|
|
|
|
img(src=user.proxyProfilePicture width=150 height=150 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}`
|
|
|
|
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
|
|
|
|
if user.posts != undefined
|
|
|
|
div.profile-counter #[span(data-numberformat=user.posts).count #{numberFormat(user.posts)}] posts
|
|
|
|
if followerCountsAvailable
|
|
|
|
if user.following != undefined
|
|
|
|
div.profile-counter #[span(data-numberformat=user.following).count #{numberFormat(user.following)}] following
|
|
|
|
if user.followedBy != undefined
|
|
|
|
div.profile-counter #[span(data-numberformat=user.followedBy).count #{numberFormat(user.followedBy)}] followed by
|
|
|
|
else
|
|
|
|
div.profile-counter.not-available Followers not available.
|
|
|
|
.links
|
|
|
|
if constants.feeds.enabled && constants.feeds.display_links
|
|
|
|
+feed_link("RSS", "rss", user.data.username, "application/rss+xml", constants.feeds.display_validation_links)
|
|
|
|
+feed_link("Atom", "atom", user.data.username, "application/atom+xml", constants.feeds.display_validation_links)
|
|
|
|
a(rel="noreferrer noopener" href=`https://www.instagram.com/${user.data.username}` target="_blank") instagram.com
|
|
|
|
section.bibliogram-meta
|
|
|
|
.links
|
|
|
|
a(href="/") Home
|
2020-05-29 08:46:45 +00:00
|
|
|
a(href=settingsReferrer) Settings
|
2020-01-12 12:50:21 +00:00
|
|
|
|
2020-01-27 12:06:44 +00:00
|
|
|
- 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)
|
2020-01-12 12:50:21 +00:00
|
|
|
|
2020-01-27 12:06:44 +00:00
|
|
|
else
|
|
|
|
div
|
|
|
|
div.page-number
|
|
|
|
span.number No posts.
|
|
|
|
|
|
|
|
else
|
|
|
|
div
|
|
|
|
div.page-number
|
|
|
|
span.number Profile is private.
|