1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-04 23:21:17 -05:00

fix: text & video embed

This commit is contained in:
diced 2022-08-15 20:55:46 -07:00
parent 7c887e8ec1
commit ecab525ffd
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1
3 changed files with 17 additions and 5 deletions

View file

@ -249,7 +249,7 @@ export default function Layout({ children, user, title }) {
color={theme.colors.gray[6]}
/>
</MediaQuery>
<Title ml='md'>{title}</Title>
<Title ml='sm'>{title}</Title>
<Box sx={{ marginLeft: 'auto', marginRight: 0 }}>
<Popover
position='bottom-end'

View file

@ -140,7 +140,8 @@ export default function Upload() {
req.open('POST', '/api/upload');
req.setRequestHeader('Authorization', user.token);
req.setRequestHeader('Expires-At', expires_at.toISOString());
expires !== 'never' && req.setRequestHeader('Expires-At', expires_at.toISOString());
req.send(body);
};

View file

@ -65,15 +65,26 @@ export default function EmbeddedImage({ image, user, pass }) {
)}
{image.mimetype.startsWith('image') && (
<>
<meta property='og:image' content={dataURL('/r')} />
<meta property='og:image' content={`/r/${image.file}`} />
<meta property='twitter:card' content='summary_large_image' />
</>
)}
{image.mimetype.startsWith('video') && (
<>
<meta property='og:video' content={dataURL('/r')} />
<meta property='og:video:url' content={dataURL('/r')} />
<meta name='twitter:card' content='player' />
<meta name='twitter:player:stream' content={`/r/${image.file}`} />
<meta name='twitter:player:width' content='720' />
<meta name='twitter:player:height' content='480' />
<meta name='twitter:player:stream:content_type' content={image.mimetype} />
<meta name='twitter:title' content={image.file} />
<meta property='og:url' content={`/r/${image.file}`} />
<meta property='og:video' content={`/r/${image.file}`} />
<meta property='og:video:url' content={`/r/${image.file}`} />
<meta property='og:video:secure_url' content={`/r/${image.file}`} />
<meta property='og:video:type' content={image.mimetype} />
<meta property='og:video:width' content='720' />
<meta property='og:video:height' content='480' />
</>
)}
<title>{image.file}</title>