mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-01 18:31:35 +00:00
Add youtube/twitter rewrite (closes #22)
This commit is contained in:
parent
a7a9af8854
commit
81b2c77b98
7 changed files with 111 additions and 54 deletions
|
|
@ -12,6 +12,8 @@ function addDefaults(input = {}) {
|
|||
} else {
|
||||
if (setting.boolean) {
|
||||
result[setting.name] = +(setting.default !== "")
|
||||
} else if (setting.name in constants.default_user_settings) {
|
||||
result[setting.name] = constants.default_user_settings[setting.name]
|
||||
} else {
|
||||
result[setting.name] = setting.default
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,14 @@ mixin fieldset(name)
|
|||
.fieldset-contents
|
||||
block
|
||||
|
||||
mixin input(id, description, placeholder, disabled)
|
||||
mixin input(id, description, placeholder, disabled, list)
|
||||
.field-row
|
||||
label.description(for=id)= description
|
||||
input(type="text" id=id name=id value=settings[id] placeholder=placeholder disabled=disabled)
|
||||
input(type="text" id=id name=id value=settings[id] placeholder=placeholder disabled=disabled list=`${id}-list`)
|
||||
if list
|
||||
datalist(id=`${id}-list`)
|
||||
each item in list
|
||||
option(value=item)
|
||||
|
||||
mixin checkbox(id, description, label, disabled)
|
||||
.field-row.checkbox-row
|
||||
|
|
@ -53,9 +57,26 @@ html
|
|||
{value: "full", text: "Full"}
|
||||
])
|
||||
|
||||
+input("rewrite_youtube", "Rewrite YouTube domain", "youtube.com", true)
|
||||
+input("rewrite_youtube", "Rewrite YouTube domain", constants.default_user_settings.rewrite_youtube, false, [
|
||||
"invidio.us",
|
||||
"invidious.snopyta.org",
|
||||
"invidious.13ad.de",
|
||||
"watch.nettohikari.com",
|
||||
"invidious.fdn.fr",
|
||||
"yewtu.be"
|
||||
])
|
||||
|
||||
+input("rewrite_twitter", "Rewrite Twitter domain", "twitter.com", true)
|
||||
+input("rewrite_twitter", "Rewrite Twitter domain", constants.default_user_settings.rewrite_twitter, false, [
|
||||
"nitter.net",
|
||||
"nitter.snopyta.org",
|
||||
"nitter.pussthecat.org",
|
||||
"nitter.42l.fr",
|
||||
"nitter.mastodont.cat",
|
||||
"nitter.tedomum.net",
|
||||
"nitter.cattube.org",
|
||||
"nitter.fdn.fr",
|
||||
"nitter.1d4.us"
|
||||
])
|
||||
|
||||
+checkbox("remove_trailing_hashtags", "Hide trailing hashtags", "Hide", false)
|
||||
|
||||
|
|
|
|||
|
|
@ -54,9 +54,10 @@ html
|
|||
- const bio = user.getStructuredBio()
|
||||
if bio
|
||||
+display_structured(bio)
|
||||
if user.data.external_url
|
||||
- const userURL = user.getRewriteLink(settings)
|
||||
if userURL
|
||||
p.website
|
||||
a(href=user.data.external_url)= user.data.external_url
|
||||
a(href=userURL)= userURL
|
||||
if user.posts != undefined
|
||||
div.profile-counter #[span(data-numberformat=user.posts).count #{numberFormat(user.posts)}] posts
|
||||
if followerCountsAvailable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue