diff --git a/packages/twenty-website/.env.example b/packages/twenty-website/.env.example index 6419d766c..071fa0f60 100644 --- a/packages/twenty-website/.env.example +++ b/packages/twenty-website/.env.example @@ -1,4 +1,2 @@ GITHUB_TOKEN=your_github_token DATABASE_PG_URL=postgres://website:website@localhost:5432/website # only if using postgres -NEXT_PUBLIC_HOST_URL=http://localhost:3000 - diff --git a/packages/twenty-website/src/app/_components/contributors/ProfileSharing.tsx b/packages/twenty-website/src/app/_components/contributors/ProfileSharing.tsx index ddfc76c3a..b38e3dcb8 100644 --- a/packages/twenty-website/src/app/_components/contributors/ProfileSharing.tsx +++ b/packages/twenty-website/src/app/_components/contributors/ProfileSharing.tsx @@ -4,7 +4,7 @@ import styled from '@emotion/styled'; import { IconDownload } from '@tabler/icons-react'; import { CardContainer } from '@/app/_components/contributors/CardContainer'; -import { GithubIcon, XIcon } from '@/app/_components/ui/icons/SvgIcons'; +import { LinkedInIcon, XIcon } from '@/app/_components/ui/icons/SvgIcons'; import { Theme } from '@/app/_components/ui/theme/theme'; const Container = styled(CardContainer)` @@ -48,15 +48,15 @@ const StyledButton = styled.a` `; interface ProfileProps { - userUrl: string; username: string; } -export const ProfileSharing = ({ userUrl, username }: ProfileProps) => { - const contributorUrl = `${process.env.NEXT_PUBLIC_HOST_URL}/contributors/${username}`; +export const ProfileSharing = ({ username }: ProfileProps) => { + const baseUrl = `${window.location.protocol}//${window.location.host}`; + const contributorUrl = `${baseUrl}/contributors/${username}`; const handleDownload = async () => { - const imageSrc = `${process.env.NEXT_PUBLIC_HOST_URL}/api/contributors/og-image/${username}`; + const imageSrc = `${baseUrl}/api/contributors/og-image/${username}`; try { const response = await fetch(imageSrc); const blob = await response.blob(); @@ -76,9 +76,12 @@ export const ProfileSharing = ({ userUrl, username }: ProfileProps) => { return ( - - - Visit Profile + + + Share on LinkedIn Download Image diff --git a/packages/twenty-website/src/app/api/releases/route.tsx b/packages/twenty-website/src/app/api/releases/route.tsx index ae5b8441c..0ffcf2838 100644 --- a/packages/twenty-website/src/app/api/releases/route.tsx +++ b/packages/twenty-website/src/app/api/releases/route.tsx @@ -23,14 +23,24 @@ export async function GET() { latestGithubRelease.tagName, ); - const formattedReleasesNotes = visibleReleasesNotes.map((releaseNote) => ({ - ...releaseNote, - publishedAt: getGithubReleaseDateFromReleaseNote( - githubReleases, - releaseNote.release, - releaseNote.date, - ), - })); + const formattedReleasesNotes = visibleReleasesNotes.map((releaseNote) => { + const updatedContent = releaseNote.content.replace( + /!\[(.*?)\]\((\/images\/.*?)\)/g, + (match, altText, imagePath) => { + return `![${altText}](https://twenty.com${imagePath})`; + }, + ); + + return { + ...releaseNote, + content: updatedContent, + publishedAt: getGithubReleaseDateFromReleaseNote( + githubReleases, + releaseNote.release, + releaseNote.date, + ), + }; + }); return Response.json(formattedReleasesNotes); } catch (error: any) { diff --git a/packages/twenty-website/src/app/contributors/[slug]/page.tsx b/packages/twenty-website/src/app/contributors/[slug]/page.tsx index 3d64342dd..e0123664b 100644 --- a/packages/twenty-website/src/app/contributors/[slug]/page.tsx +++ b/packages/twenty-website/src/app/contributors/[slug]/page.tsx @@ -58,10 +58,7 @@ export default async function ({ params }: { params: { slug: string } }) { rank={rank} activeDays={activeDays} /> - +