feat: add option to make post titles open link, close #476

This commit is contained in:
James Xylight committed 2025-06-25 17:48:44 -07:00
1 parent 551c3aa8e8
commit 0563227684
5 files changed
+20 -1

No files matched your search

@@ -133,6 +133,7 @@
style="grid-area: meta;"
edited={post.post.updated}
tags={tags?.tags}
postUrl={post.post.url}
{view}
{extraBadges}
/>
@@ -98,6 +98,7 @@
style?: string
titleClass?: string
extraBadges?: import('svelte').Snippet
postUrl?: string
}
let {
@@ -122,6 +123,7 @@
admin: false,
},
tags = [],
postUrl,
style = '',
titleClass = '',
extraBadges,
@@ -332,7 +334,12 @@
</header>
{#if title && id}
<a
href="/post/{encodeURIComponent(instance.data)}/{id}"
href={settings.posts.titleOpensUrl && postUrl
? postUrl
: `/post/${encodeURIComponent(instance.data)}/${id}`}
target={settings.posts.titleOpensUrl || settings.openLinksInNewTab
? '_blank'
: undefined}
class={[
'inline max-[480px]:mt-0!',
'hover:underline hover:text-primary-900 dark:hover:text-primary-100 transition-colors',