-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve SEO, add eslint and prettier
- Loading branch information
1 parent
b719374
commit b64233a
Showing
42 changed files
with
1,542 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
"next/core-web-vitals" | ||
], | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"prettier/prettier": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
|
||
.next/ | ||
.next/ | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,148 @@ | ||
import { ReactNode } from 'react' | ||
import { notFound } from 'next/navigation' | ||
import { NextIntlClientProvider } from 'next-intl' | ||
import {unstable_setRequestLocale} from 'next-intl/server'; | ||
import { Metadata } from 'next' | ||
import '../globals.css' | ||
import { ReactNode } from "react"; | ||
import { notFound } from "next/navigation"; | ||
import { NextIntlClientProvider } from "next-intl"; | ||
import { unstable_setRequestLocale } from "next-intl/server"; | ||
import { Metadata } from "next"; | ||
import "../globals.css"; | ||
|
||
type Props = { | ||
children: ReactNode | ||
params: { locale: string } | ||
} | ||
children: ReactNode; | ||
params: { locale: string }; | ||
}; | ||
|
||
export const metadata: Metadata = { | ||
title: 'ARKA', | ||
description: 'Arka é uma consultoria especializada em gestão de coleções digitais atuando no Brasil e em projetos internacionais.', | ||
} | ||
export const metadata = (locale: string): Metadata => { | ||
const commonMetadata = { | ||
title: "ARKA", | ||
openGraph: { | ||
url: "https://arka.la", | ||
images: [ | ||
{ | ||
url: "https://avatars.githubusercontent.com/u/152537545?s=200&v=4", | ||
width: 200, | ||
height: 200, | ||
alt: "Arka Logo", | ||
}, | ||
], | ||
}, | ||
twitter: { | ||
card: "summary_large_image", | ||
site: "@arka", | ||
images: ["https://avatars.githubusercontent.com/u/152537545?s=200&v=4"], | ||
}, | ||
}; | ||
|
||
let description; | ||
let keywords; | ||
|
||
switch (locale) { | ||
case "en": | ||
description = | ||
"Arka is a digital studio specialized in digital collections, operating in Brazil and abroad"; | ||
keywords = [ | ||
"iiif", | ||
"collections", | ||
"machine learning", | ||
"consultancy", | ||
"digital humanities", | ||
"digital strategy", | ||
"museums", | ||
"galleries", | ||
"archives", | ||
"libraries", | ||
"cultural heritage", | ||
]; | ||
case "pt": | ||
description = | ||
"Arka é um estúdio digital especializado em coleções digitais, atuando no Brasil e em projetos internacionais"; | ||
keywords = [ | ||
"iiif", | ||
"acervos", | ||
"inteligência artificial", | ||
"patrimônio cultural", | ||
"consultoria", | ||
"humanidades digitais", | ||
"estratégia digital", | ||
"museus", | ||
"galerias", | ||
"arquivos", | ||
"bibliotecas", | ||
]; | ||
case "es": | ||
description = | ||
"Arka es un estudio digital especializado en colecciones digitales, que opera en Brasil y en el extranjero."; | ||
keywords = [ | ||
"iiif", | ||
"colecciones", | ||
"museos", | ||
"galerias", | ||
"archivos", | ||
"bibliotecas", | ||
"humanidades digitales", | ||
"consultoria", | ||
"estrategia digital", | ||
"patrimonio cultural", | ||
"inteligencia artificial", | ||
]; | ||
} | ||
return { | ||
description: description, | ||
keywords: keywords, | ||
...commonMetadata, | ||
openGraph: { | ||
...commonMetadata.openGraph, | ||
description: description, | ||
}, | ||
twitter: { | ||
...commonMetadata.twitter, | ||
description: description, | ||
}, | ||
}; | ||
}; | ||
|
||
//function to get the translations | ||
async function getMessages(locale: string) { | ||
try { | ||
return (await import(`../../messages/${locale}.json`)).default | ||
} catch (error) { | ||
notFound() | ||
} | ||
try { | ||
return (await import(`../../messages/${locale}.json`)).default; | ||
} catch (error) { | ||
notFound(); | ||
} | ||
} | ||
|
||
//function to generate the routes for all the locales | ||
export async function generateStaticParams() { | ||
return ['en', 'pt'].map((locale) => ({ locale })) | ||
return ["en", "pt"].map((locale) => ({ locale })); | ||
} | ||
|
||
export default async function RootLayout({ children, params: { locale } }: Props) { | ||
unstable_setRequestLocale(locale); | ||
const messages = await getMessages(locale) | ||
return ( | ||
<html lang={locale}> | ||
<body> | ||
<NextIntlClientProvider locale={locale} messages={messages}> | ||
{children} | ||
</NextIntlClientProvider> | ||
</body> | ||
</html> | ||
) | ||
export default async function RootLayout({ | ||
children, | ||
params: { locale }, | ||
}: Props) { | ||
unstable_setRequestLocale(locale); | ||
const messages = await getMessages(locale); | ||
return ( | ||
<html lang={locale}> | ||
<body> | ||
<NextIntlClientProvider locale={locale} messages={messages}> | ||
{children} | ||
</NextIntlClientProvider> | ||
</body> | ||
<script | ||
type="application/ld+json" | ||
dangerouslySetInnerHTML={{ | ||
__html: JSON.stringify({ | ||
"@context": "https://schema.org", | ||
"@type": "Corporation", | ||
name: "Arka", | ||
url: "https://arka.la", | ||
logo: "https://avatars.githubusercontent.com/u/152537545?s=200&v=4", | ||
sameAs: [ | ||
"https://arka.la", | ||
"https://www.linkedin.com/company/arkalab", | ||
"https://github.com/arkalab", | ||
], | ||
}), | ||
}} | ||
/> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
import { ReactNode } from "react"; | ||
|
||
type Props = { | ||
children: ReactNode; | ||
}; | ||
|
||
|
||
export default function RootLayout({ children }: Props) { | ||
return children; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
'use client' | ||
"use client"; | ||
|
||
import { redirect } from 'next/navigation'; | ||
import { redirect } from "next/navigation"; | ||
|
||
export default function RootPage() { | ||
redirect('/en'); | ||
redirect("/en"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
User-agent: * | ||
Allow: / | ||
Disallow: | ||
Sitemap: https://arka.la/sitemap.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
<url> | ||
<loc>https://arka.la</loc> | ||
<xhtml:link | ||
rel="alternate" | ||
hreflang="en" | ||
href="https://arka.la/en"/> | ||
<xhtml:link | ||
rel="alternate" | ||
hreflang="pt" | ||
href="https://arka.la/pt"/> | ||
<lastmod>2024-06-20T15:02:24.021Z</lastmod> | ||
<changefreq>monthly</changefreq> | ||
<priority>1</priority> | ||
</url> | ||
</urlset> |
Oops, something went wrong.