make seo helper service buttons optional and reuse components v2 script builder for meta on every page
Frontend CI/CD / test-and-build (push) Successful in 25s
Frontend CI/CD / deploy (push) Successful in 26s

This commit is contained in:
itzMiney committed 2026-11-08 01:54:41 +01:00
1 parent 921659a2c2
commit 8976d56495
1 file changed
+30 -27
+30 -27
View File
@@ -54,39 +54,42 @@ export class SeoService {
existingScript.remove();
}
if (!buttons || buttons.length === 0) return;
const sectionComponent = {
type: 9,
components: [
{
type: 10,
content: `### [${meta?.title ?? ''}](${meta?.currentUrl ?? ''})\n${meta?.description ?? ''}`
}
],
accessory: {
type: 11,
media: {
url: 'https://itzminey.dev/assets/thumb.png'
}
}
};
const containerComponents: any[] = [sectionComponent];
if (buttons && buttons.length > 0) {
containerComponents.push({
type: 1,
components: buttons.map(btn => ({
type: 2,
label: btn.label,
style: 5,
url: btn.url
}))
});
}
const componentPayload = {
flags: 32768,
component: {
type: 17,
accent_color: parseInt(this.siteColor.replace('#', ''), 16),
components: [
{
type: 9,
components: [
{
type: 10,
content: `### [${meta?.title ?? ''}](${meta?.currentUrl ?? ''})\n${meta?.description ?? ''}`
}
],
accessory: {
type: 11,
media: {
url: 'https://itzminey.dev/assets/thumb.png'
}
}
},
{
type: 1, // Action Row for buttons
components: buttons.map(btn => ({
type: 2,
label: btn.label,
style: 5,
url: btn.url
}))
}
]
components: containerComponents
}
};