mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Updated NFT OEmbed provider to return metadata
refs https://github.com/TryGhost/Team/issues/1211 Instead of rendering the HTML as an embed - we will send back the necessary data. This will allow us to keep all the knowledge of HTML structure in the Koenig repository.
This commit is contained in:
parent
c2fe04f681
commit
31e103be9d
1 changed files with 5 additions and 16 deletions
|
@ -46,24 +46,13 @@ class NFTOEmbedProvider {
|
||||||
author_url: `https://opensea.io/${result.body.creator.user.username}`,
|
author_url: `https://opensea.io/${result.body.creator.user.username}`,
|
||||||
provider_name: 'OpenSea',
|
provider_name: 'OpenSea',
|
||||||
provider_url: 'https://opensea.io',
|
provider_url: 'https://opensea.io',
|
||||||
html: `
|
html: '',
|
||||||
<a href="${result.body.permalink}" class="kg-nft-card">
|
|
||||||
<img class="kg-nft-image" src="${result.body.image_url}">
|
|
||||||
<div class="kg-nft-metadata">
|
|
||||||
<div class="kg-nft-header">
|
|
||||||
<h4 class="kg-nft-title"> ${result.body.name} </h4>
|
|
||||||
</div>
|
|
||||||
<div class="kg-nft-creator">
|
|
||||||
Created by <span class="kg-nft-creator-name">${result.body.creator.user.username}</span>
|
|
||||||
${(result.body.collection.name ? `• ${result.body.collection.name}` : ``)}
|
|
||||||
</div>
|
|
||||||
${(result.body.description ? `<p class="kg-nft-description">${result.body.description}</p>` : ``)}
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
`,
|
|
||||||
width: 1000,
|
width: 1000,
|
||||||
height: 1000,
|
height: 1000,
|
||||||
noIframe: true
|
card_type: 'nft',
|
||||||
|
image_url: result.body.image_url,
|
||||||
|
creator_name: result.body.creator.user.username,
|
||||||
|
description: result.body.description
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue