mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-28 07:14:05 -06:00
fix: og preview on discord
This commit is contained in:
parent
5400b273f7
commit
ee15e27265
@ -73,8 +73,8 @@ async function generateSvg(
|
||||
/>
|
||||
</div>,
|
||||
{
|
||||
width: 1200,
|
||||
height: 675,
|
||||
width: ogHeight,
|
||||
height: ogWidth,
|
||||
fonts: [
|
||||
{
|
||||
name: fontName,
|
||||
@ -97,6 +97,9 @@ async function generateSvg(
|
||||
fs.writeFileSync(`public/static/${filePath}.png`, pngBuffer)
|
||||
}
|
||||
|
||||
const ogHeight = 1200
|
||||
const ogWidth = 676
|
||||
|
||||
export default (() => {
|
||||
let font: Promise<ArrayBuffer | undefined>
|
||||
function Head({ cfg, fileData, externalResources }: QuartzComponentProps) {
|
||||
@ -136,6 +139,12 @@ export default (() => {
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
<meta property="og:image:alt" content={fileData.description} />
|
||||
<meta property="og:image:width" content={"" + ogWidth} />
|
||||
<meta property="og:image:height" content={"" + ogHeight} />
|
||||
<meta property="og:image:url" content={ogImagePathNew} />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta property="twitter:url" content={`https://${cfg.baseUrl}/${fileData.slug}`}></meta>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user