Skip to content

Commit

Permalink
fix: preview image for hacktoberfest page
Browse files Browse the repository at this point in the history
  • Loading branch information
blenderskool committed Oct 11, 2023
1 parent 8661770 commit 1f0f517
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Binary file added public/razorpay-hacktoberfest-site-preview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions renderer/_default.page.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ async function render(pageContext: PageContextBuiltIn & PageContext) {
const desc =
(documentProps && documentProps.description) || 'Razorpay Open Source';

const sitePreview =
(documentProps && documentProps.sitePreview) ||
'https://opensource.razorpay.com/site-preview.jpg';

const documentHtml = escapeInject`<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -38,14 +42,14 @@ async function render(pageContext: PageContextBuiltIn & PageContext) {
<meta property="og:url" content="https://opensource.razorpay.com/">
<meta property="og:title" content="${title}">
<meta property="og:description" content="${desc}">
<meta property="og:image" content="https://opensource.razorpay.com/site-preview.jpg">
<meta property="og:image" content="${sitePreview}">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://opensource.razorpay.com/">
<meta property="twitter:title" content="${title}">
<meta property="twitter:description" content="${desc}">
<meta property="twitter:image" content="https://opensource.razorpay.com/site-preview.jpg">
<meta property="twitter:image" content="${sitePreview}">
<link rel="icon" type="image/png" href="https://opensource.razorpay.com/favicon.png">
Expand Down
1 change: 1 addition & 0 deletions renderer/usePageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type PageContext = {
documentProps?: {
title?: string;
description?: string;
sitePreview?: string;
};
};
};
Expand Down
2 changes: 2 additions & 0 deletions src/pages/hacktoberfest-2023.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,6 @@ export const Page = ({ projects }: PageData) => {

export const documentProps = {
title: 'Hacktoberfest 2023 | Razorpay Open Source',
sitePreview:
'https://opensource.razorpay.com/razorpay-hacktoberfest-site-preview.png',
};

0 comments on commit 1f0f517

Please sign in to comment.