feat: implement elk permalinks (#229)

This commit is contained in:
Daniel Roe 2022-11-29 20:51:52 +00:00 committed by GitHub
parent 26f2dec6b6
commit 6efd3c8b55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 8 deletions

View file

@ -1,5 +1,6 @@
import type { Ref } from 'vue'
import type { Account, Relationship, Status } from 'masto'
import { withoutProtocol } from 'ufo'
// @unocss-include
export const STATUS_VISIBILITIES = [
@ -71,6 +72,10 @@ export function getStatusPath(status: Status) {
return `/${getFullHandle(status.account)}/${status.id}`
}
export function getStatusPermalink(status: Status) {
return status.url ? `/${withoutProtocol(status.url)}` : null
}
export function getStatusInReplyToPath(status: Status) {
return `/status/${status.inReplyToId}`
}