Skip to content

Commit

Permalink
fix: use direct OpenGraph Image URLs on repository insight pages (#3256)
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Taylor <[email protected]>
  • Loading branch information
brandonroberts and nickytonline committed Apr 25, 2024
1 parent 42dec10 commit 0578019
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 26 deletions.
20 changes: 0 additions & 20 deletions lib/utils/fetch-social-card.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
import { useState } from "react";
import dynamic from "next/dynamic";
import SEO from "layouts/SEO/SEO";
import fetchSocialCard from "lib/utils/fetch-social-card";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import HubPageLayout from "layouts/hub-page";
import Activity from "components/organisms/Activity/activity";
Expand Down Expand Up @@ -98,7 +97,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
}

// Keeping this here so we are sure the page is not private before we fetch the social card.
const ogImage = await fetchSocialCard(`insights/${insightId}`);
const ogImage = `${process.env.NEXT_PUBLIC_OPENGRAPH_URL}/insights/${insightId}`;

const { data: workspaceMembers } = await fetchApiData<{ data?: WorkspaceMember[] }>({
path: `workspaces/${workspaceId}/members`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";

import dynamic from "next/dynamic";
import SEO from "layouts/SEO/SEO";
import fetchSocialCard from "lib/utils/fetch-social-card";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import HubPageLayout from "layouts/hub-page";
import Contributors from "components/organisms/Contributors/contributors";
Expand Down Expand Up @@ -103,7 +102,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
}

// Keeping this here so we are sure the page is not private before we fetch the social card.
const ogImage = await fetchSocialCard(`insights/${insightId}`);
const ogImage = `${process.env.NEXT_PUBLIC_OPENGRAPH_URL}/insights/${insightId}`;

const { data: workspaceMembers } = await fetchApiData<{ data?: WorkspaceMember[] }>({
path: `workspaces/${workspaceId}/members`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";

import dynamic from "next/dynamic";
import SEO from "layouts/SEO/SEO";
import fetchSocialCard from "lib/utils/fetch-social-card";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import HubPageLayout from "layouts/hub-page";
import Dashboard from "components/organisms/Dashboard/dashboard";
Expand Down Expand Up @@ -104,7 +103,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
}

// Keeping this here so we are sure the page is not private before we fetch the social card.
const ogImage = await fetchSocialCard(`insights/${insightId}`);
const ogImage = `${process.env.NEXT_PUBLIC_OPENGRAPH_URL}/insights/${insightId}`;

const { data: workspaceMembers } = await fetchApiData<{ data?: WorkspaceMember[] }>({
path: `workspaces/${workspaceId}/members`,
Expand Down

0 comments on commit 0578019

Please sign in to comment.