Update modules/ui/ui.py
Browse files- modules/ui/ui.py +21 -7
modules/ui/ui.py
CHANGED
|
@@ -32,12 +32,19 @@ export default function(component) {
|
|
| 32 |
head.appendChild(meta);
|
| 33 |
};
|
| 34 |
|
| 35 |
-
//
|
| 36 |
-
if (data.title) setMetaTag('og:title', data.title);
|
| 37 |
-
if (data.description) setMetaTag('og:description', data.description);
|
| 38 |
-
if (data.image) setMetaTag('og:image', data.image);
|
| 39 |
-
if (data.url) setMetaTag('og:url', data.url);
|
| 40 |
setMetaTag('og:type', 'website');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
// Inject Twitter Card tags
|
| 43 |
if (data.title) setMetaTag('twitter:title', data.title);
|
|
@@ -56,7 +63,7 @@ meta_component = st.components.v2.component(
|
|
| 56 |
|
| 57 |
# 3. Use standard page configuration for the browser tab title & favicon
|
| 58 |
st.set_page_config(
|
| 59 |
-
page_title="
|
| 60 |
page_icon="🚀"
|
| 61 |
)
|
| 62 |
|
|
@@ -64,8 +71,15 @@ st.set_page_config(
|
|
| 64 |
meta_component(data={
|
| 65 |
"title": "AIdeaText",
|
| 66 |
"description": "AIdeaText is a multimodal cognitive assessment platform",
|
|
|
|
|
|
|
|
|
|
| 67 |
"image": "https://huggingface.co/spaces/AIdeaText/v5Prod/resolve/main/assets/img/socialmedia/AIdeaText_sm_cover.png",
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
})
|
| 70 |
|
| 71 |
##########################################
|
|
|
|
| 32 |
head.appendChild(meta);
|
| 33 |
};
|
| 34 |
|
| 35 |
+
// Explicit Open Graph standard definitions
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
setMetaTag('og:type', 'website');
|
| 37 |
+
setMetaTag('og:title', data.title);
|
| 38 |
+
setMetaTag('og:description', data.description);
|
| 39 |
+
setMetaTag('og:url', data.url);
|
| 40 |
+
|
| 41 |
+
// CRITICAL: Explicitly set the base image tag
|
| 42 |
+
setMetaTag('og:image', data.image);
|
| 43 |
+
|
| 44 |
+
// Optional structural helpers to assist lazy scrapers:
|
| 45 |
+
if (data.image_type) setMetaTag('og:image:type', data.image_type);
|
| 46 |
+
if (data.image_width) setMetaTag('og:image:width', data.image_width);
|
| 47 |
+
if (data.image_height) setMetaTag('og:image:height', data.image_height);
|
| 48 |
|
| 49 |
// Inject Twitter Card tags
|
| 50 |
if (data.title) setMetaTag('twitter:title', data.title);
|
|
|
|
| 63 |
|
| 64 |
# 3. Use standard page configuration for the browser tab title & favicon
|
| 65 |
st.set_page_config(
|
| 66 |
+
page_title="AIdeaText",
|
| 67 |
page_icon="🚀"
|
| 68 |
)
|
| 69 |
|
|
|
|
| 71 |
meta_component(data={
|
| 72 |
"title": "AIdeaText",
|
| 73 |
"description": "AIdeaText is a multimodal cognitive assessment platform",
|
| 74 |
+
"url": "https://app.aideatext.ai",
|
| 75 |
+
|
| 76 |
+
# MUST BE AN ABSOLUTE SECURE URL
|
| 77 |
"image": "https://huggingface.co/spaces/AIdeaText/v5Prod/resolve/main/assets/img/socialmedia/AIdeaText_sm_cover.png",
|
| 78 |
+
|
| 79 |
+
# Providing these helps the Facebook Debugger pre-size the card safely
|
| 80 |
+
"image_type": "image/png",
|
| 81 |
+
"image_width": "1200",
|
| 82 |
+
"image_height": "630"
|
| 83 |
})
|
| 84 |
|
| 85 |
##########################################
|