feat: configurable favicon service URL (#659)

This commit is contained in:
Alex Gleason 2025-11-14 05:28:10 -03:00 committed by GitHub
parent e544c0a801
commit f8cca5522f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 151 additions and 20 deletions

19
src/lib/faviconUrl.ts Normal file
View file

@ -0,0 +1,19 @@
import UriTemplate from 'uri-templates'
export function faviconUrl(template: string, url: string | URL): string {
const u = new URL(url)
return UriTemplate(template).fill({
href: u.href,
origin: u.origin,
protocol: u.protocol,
username: u.username,
password: u.password,
host: u.host,
hostname: u.hostname,
port: u.port,
pathname: u.pathname,
hash: u.hash,
search: u.search
})
}

View file

@ -72,6 +72,7 @@ export const toGeneralSettings = () => '/settings/general'
export const toAppearanceSettings = () => '/settings/appearance'
export const toTranslation = () => '/settings/translation'
export const toEmojiPackSettings = () => '/settings/emoji-packs'
export const toSystemSettings = () => '/settings/system'
export const toProfileEditor = () => '/profile-editor'
export const toRelay = (url: string) => `/relays/${encodeURIComponent(url)}`
export const toRelayReviews = (url: string) => `/relays/${encodeURIComponent(url)}/reviews`