Modified URLs and added button to share on LinkedIn (#5306)

- Removed the env variable and added the current URL in contributor's
page
- Added button to share on LinkedIn on contributor's profile
- Fixed absolute image URL for release API

---------

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
This commit is contained in:
Ady Beraud
2024-05-07 09:59:03 +03:00
committed by GitHub
parent b438fc2754
commit 43cd8cc451
4 changed files with 30 additions and 22 deletions

View File

@ -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) {