feat: meta image and keywords from settings

This commit is contained in:
Jannat Patel
2025-04-19 12:37:24 +05:30
parent 73941a159a
commit eb0587f726
5 changed files with 59 additions and 14 deletions

View File

@@ -352,10 +352,23 @@ const tabsStructure = computed(() => {
label: 'Meta Description',
name: 'meta_description',
type: 'textarea',
rows: 5,
rows: 4,
description:
"This description will be shown on lists and pages that don't have meta description",
},
{
label: 'Meta Keywords',
name: 'meta_keywords',
type: 'textarea',
rows: 4,
description:
'Keywords for search engines to find your website. Separated by commas.',
},
{
label: 'Meta Image',
name: 'meta_image',
type: 'Upload',
},
],
},
],

View File

@@ -51,7 +51,9 @@ const props = defineProps({
const update = () => {
props.fields.forEach((f) => {
if (f.type != 'Column Break') {
if (f.type == 'Upload') {
props.data.doc[f.name] = f.value ? f.value.file_url : null
} else if (f.type != 'Column Break') {
props.data.doc[f.name] = f.value
}
})

View File

@@ -54,15 +54,24 @@
<div v-else>
<div class="flex items-center text-sm space-x-2">
<div
class="flex items-center justify-center rounded border border-outline-gray-modals bg-white w-[10rem] py-5"
class="flex items-center justify-center rounded border border-outline-gray-modals bg-white w-[10rem] py-2"
>
<img :src="data[field.name]?.file_url" class="h-6 rounded" />
<img
:src="data[field.name]?.file_url || data[field.name]"
class="w-[80%] rounded"
/>
</div>
<div class="flex flex-col flex-wrap">
<span class="break-all text-ink-gray-9">
{{ data[field.name]?.file_name }}
{{
data[field.name]?.file_name ||
data[field.name].split('/').pop()
}}
</span>
<span class="text-sm text-ink-gray-5 mt-1">
<span
v-if="data[field.name]?.file_size"
class="text-sm text-ink-gray-5 mt-1"
>
{{ getFileSize(data[field.name]?.file_size) }}
</span>
</div>