feat: make tag rules customizable

This commit is contained in:
Xylight committed 2024-07-09 13:25:35 -07:00
1 parent 3e563ad1cc
commit 7877c97aeb
4 files changed
+40 -2

No files matched your search

+1 -1
View File
@@ -150,7 +150,7 @@
/>
{/if}
{/key}
{#if post.post.body && !post.post.nsfw && view != 'compact' && !hideBody}
{#if post.post.body && !post.post.nsfw && view != 'compact' && !hideBody && rule != 'hide'}
<PostBody body={post.post.body} {view} style="grid-area: body" />
{/if}
{#if actions}
+7 -1
View File
@@ -639,7 +639,13 @@
},
"titleTags": {
"title": "Parse tags in title",
"description": "Take text in [brackets] and turn it into tags that you can click to search for."
"description": "Take text in [brackets] and turn it into tags that you can click to search for.",
"rules": {
"title": "Rules",
"blur": "Blur",
"hide": "Hide",
"show": "Show"
}
}
},
"embeds": {
+3
View File
@@ -91,6 +91,7 @@ interface Settings {
language: string | null
useRtl: boolean
translator: string | undefined
parseTags: boolean
tagRules: {
[key: string]: 'hide' | 'blur'
}
@@ -162,9 +163,11 @@ export const defaultSettings: Settings = {
language: env.PUBLIC_LANGUAGE ?? null,
useRtl: false,
translator: env.PUBLIC_TRANSLATOR ?? undefined,
parseTags: true,
tagRules: {
cw: 'blur',
nsfl: 'blur',
nsfw: 'blur',
},
}