fix: link post authors by slug, not by login
This commit is contained in:
@@ -11,9 +11,15 @@ const links = useJournalLinks()
|
||||
const date = computed(() => formatJournalDate(props.post.published_at, localeProperties.value.language ?? 'en'))
|
||||
const authorName = computed(() => {
|
||||
const a = props.post.author
|
||||
return a ? `${a.first_name} ${a.last_name}`.trim() || a.login : ''
|
||||
return a ? `${a.first_name} ${a.last_name}`.trim() || a.slug || a.login : ''
|
||||
})
|
||||
// By slug, so the link does not carry the login (often an email address).
|
||||
// An API before sm-journal-plugin v0.3.1 sends no slug; the login still
|
||||
// resolves there.
|
||||
const authorHref = computed(() => {
|
||||
const a = props.post.author
|
||||
return a ? links.authorLink(a.slug || a.login) : null
|
||||
})
|
||||
const authorHref = computed(() => (props.post.author ? links.authorLink(props.post.author.login) : null))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user