mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
add support for richer entities
This commit is contained in:
parent
1cefaaab55
commit
a8dcd920cf
2 changed files with 25 additions and 2 deletions
|
@ -89,11 +89,10 @@ function createSearchResultPage(context, result, doodle){
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: result.card.images.thumbnail
|
url: result.card.images.thumbnail
|
||||||
},
|
},
|
||||||
description: ``,
|
description: '',
|
||||||
footer: renderFooter(context, doodle)
|
footer: renderFooter(context, doodle)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
if(!result.card.images.preview && result.card.link == ""){
|
if(!result.card.images.preview && result.card.link == ""){
|
||||||
delete res.author
|
delete res.author
|
||||||
res.description = `### ${result.card.title}\n`
|
res.description = `### ${result.card.title}\n`
|
||||||
|
@ -111,6 +110,18 @@ function createSearchResultPage(context, result, doodle){
|
||||||
|
|
||||||
if(result.card.images.preview) res.author.iconUrl = result.card.images.preview;
|
if(result.card.images.preview) res.author.iconUrl = result.card.images.preview;
|
||||||
|
|
||||||
|
if(result.card.images.image) res.image = {
|
||||||
|
url: result.card.images.image
|
||||||
|
};
|
||||||
|
|
||||||
|
if(result.card.facts) res.fields = result.card.facts.map((f)=>{
|
||||||
|
return {
|
||||||
|
name: f.label,
|
||||||
|
value: f.value,
|
||||||
|
inline: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
if(result.card.link) res.author.url = result.card.link
|
if(result.card.link) res.author.url = result.card.link
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -111,6 +111,18 @@ function createSearchResultPage(context, result, doodle){
|
||||||
|
|
||||||
if(result.card.images.preview) res.author.iconUrl = result.card.images.preview;
|
if(result.card.images.preview) res.author.iconUrl = result.card.images.preview;
|
||||||
|
|
||||||
|
if(result.card.images.image) res.image = {
|
||||||
|
url: result.card.images.image
|
||||||
|
};
|
||||||
|
|
||||||
|
if(result.card.facts) res.fields = result.card.facts.map((f)=>{
|
||||||
|
return {
|
||||||
|
name: f.label,
|
||||||
|
value: f.value,
|
||||||
|
inline: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
if(result.card.link) res.author.url = result.card.link
|
if(result.card.link) res.author.url = result.card.link
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue