feat: tweak url preview title priority
This commit is contained in:
@@ -66,6 +66,9 @@ const StyledDetails = styled.a`
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
color: #06aed4;
|
color: #06aed4;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.desc {
|
.desc {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@@ -95,7 +98,7 @@ export default function URLPreview({ url = "" }) {
|
|||||||
const getMetaData = async (url) => {
|
const getMetaData = async (url) => {
|
||||||
// todo
|
// todo
|
||||||
const { data } = await getInfo(url);
|
const { data } = await getInfo(url);
|
||||||
const title = data.site_name || data.title;
|
const title = data.title || data.site_name;
|
||||||
const description = data.description;
|
const description = data.description;
|
||||||
const ogImage = data.images.find((i) => !!i.url)?.url || "";
|
const ogImage = data.images.find((i) => !!i.url)?.url || "";
|
||||||
const favicon = data.favicon_url || `${new URL(url).origin}/favicon.ico`;
|
const favicon = data.favicon_url || `${new URL(url).origin}/favicon.ico`;
|
||||||
|
|||||||
Reference in New Issue
Block a user