Skip to content

Commit

Permalink
Fixed some data fetched by GitHub API for metadata generation
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Dec 21, 2023
1 parent ce86604 commit 85835ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export async function generateMetadata(): Promise<

// On détermine après certaines métadonnées récurrentes.
const banner = `https://opengraph.githubassets.com/${ commits.sha }/${ repository.full_name }`;
const title = repository.name.replaceAll( "-", " " );
const url =
process.env.NEXT_PUBLIC_ENV === "production"
? repository.homepage
Expand All @@ -93,7 +94,7 @@ export async function generateMetadata(): Promise<
// avant de les enregistrer dans un fichier JSON.
const metadata = {
// Métadonnées du document.
title: repository.name,
title,
source: repository.html_url,
authors: [ { name: author.name, url: author.html_url } ],
keywords: repository.topics,
Expand Down Expand Up @@ -142,7 +143,7 @@ export async function generateMetadata(): Promise<
openGraph: {
url,
type: "website",
title: repository.name,
title,
description: repository.description,
images: [
{
Expand All @@ -153,7 +154,7 @@ export async function generateMetadata(): Promise<

// Informations pour la plate-forme Twitter.
twitter: {
title: repository.name,
title,
creator: `@${ author.twitter_username }`,
description: repository.description,
images: [
Expand Down

0 comments on commit 85835ec

Please sign in to comment.