add facts support to maps

This commit is contained in:
bignutty 2024-12-08 00:50:20 +01:00
parent 400efb8064
commit dcb823a0a1
2 changed files with 33 additions and 5 deletions

View file

@ -44,9 +44,24 @@ function renderPlaceCard(context, place) {
cards[0].description += `\n\n${place.description}`
}
if(place.facts?.length) {
let fc = 1;
cards[0].fields = place.facts.map((f)=>{
let factField = {
name: f.label,
value: f.value,
inline: true
}
if(f.source){
factField.value += citation(fc++, f.source.url, f.source.label)
}
return factField;
})
}
if (place.photos?.length) {
cards[0].image = {
url: place.photos.shift()
}