Skip to content

Commit

Permalink
Drop Nextra, use next-intl
Browse files Browse the repository at this point in the history
  • Loading branch information
martimpassos committed Jun 19, 2024
1 parent 44bc5b5 commit 48c57ae
Show file tree
Hide file tree
Showing 50 changed files with 617 additions and 556 deletions.
44 changes: 44 additions & 0 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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 }
}

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.',
}

//function to get the translations
async function getMessages(locale: string) {
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 }))
}

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>
)
}
31 changes: 31 additions & 0 deletions app/[locale]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 'use client'
import { useTranslations } from 'next-intl'
import { unstable_setRequestLocale } from 'next-intl/server';

import Hero from '../../src/components/Hero'
import About from '../../src/components/About'
import Team from '../../src/components/Team'
import Partners from '../../src/components/Partners'
import Projects from '../../src/components/Projects'
import MainContent from '../../src/components/MainContent'
import Footer from "../../src/components/Footer"
import Link from 'next/link'


export default function HomePage({ params: { locale } }) {
unstable_setRequestLocale(locale);
return (
<>
<Hero />
<MainContent>
<About />
<Team />
<Partners />
<Projects />
</MainContent>
<Footer>
<Link href="mailto:[email protected]">[email protected]</Link>
</Footer>
</>
);
}
Binary file added app/favicon.ico
Binary file not shown.
8 changes: 4 additions & 4 deletions src/app/globals.css → app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ body {}

@font-face {
font-family: "Jost";
src: url("../../support_files/fonts/Jost-Light.ttf");
src: url("../support_files/fonts/Jost-Light.ttf");
font-weight: 300;
font-style: light;
}

@font-face {
font-family: "Jost";
src: url("../../support_files/fonts/Jost-Regular.ttf");
src: url("../support_files/fonts/Jost-Regular.ttf");
font-weight: 400;
font-style: regular;
}

@font-face {
font-family: "Jost";
src: url("../../support_files/fonts/Jost-MediumItalic.ttf");
src: url("../support_files/fonts/Jost-MediumItalic.ttf");
font-weight: 500;
font-style: medium;
}

@font-face {
font-family: "Jost";
src: url("../../support_files/fonts/Jost-Bold.ttf");
src: url("../support_files/fonts/Jost-Bold.ttf");
font-weight: 700;
font-style: bold;
}
11 changes: 11 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ReactNode } from 'react';


type Props = {
children: ReactNode;
};


export default function RootLayout({ children }: Props) {
return children;
}
8 changes: 8 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use client'

import { redirect } from 'next/navigation';

export default function RootPage() {
redirect('/en');
}

3 changes: 0 additions & 3 deletions components/ContentBoxSubTitle.jsx

This file was deleted.

5 changes: 0 additions & 5 deletions components/ContentBoxTitle.jsx

This file was deleted.

18 changes: 0 additions & 18 deletions components/Header.jsx

This file was deleted.

33 changes: 0 additions & 33 deletions components/locale-switch.jsx

This file was deleted.

55 changes: 55 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"HomePage": {
"Hero": {
"description": "We are a <nobreak><highlight>digital studio</highlight></nobreak> specialized in research and development for cultural heritage institutions and <nobreak>private collectors</nobreak>"
},
"About": {
"title": "About",
"description": "We use AI and open standards to digitize, catalog, and share artworks and historical documents on the web",
"infrastructure": {
"title": "IIIF infrastructure",
"description": "Implementation of the International Image Interoperability Framework"
},
"computer-vision": {
"title":"Computer Vision",
"description": "Object detection, content classification, manuscript transcription"
}
},
"Team": {
"Anita": {
"name": "Anita Lucchesi",
"role": "Business"
},
"Bruno": {
"name": "Bruno Buccalon",
"role": "Design"
},
"Martim": {
"name": "Martim Passos",
"role": "Technology"
},
"Yuri": {
"name": "Yuri Tavares",
"role": "Technology"
}
},
"Partners": {
"title": "Partners"
},
"Projects": {
"title": "Projects",
"tropiiify": {
"title": "tropiiify",
"description": "Tropy plugin for exporting IIIF collections"
},
"imaginerio": {
"title": "imagineRio",
"description": "Historical mapping of Rio de Janeiro"
}
}
},
"LocaleSwitcher": {
"label": "Change language",
"locale": "{locale, select, pt {Português} en {English} other {Unknown}}"
}
}
55 changes: 55 additions & 0 deletions messages/pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"HomePage": {
"Hero": {
"description": "Somos um <nobreak><highlight>estúdio digital</highlight></nobreak> especializado em pesquisa e desenvolvimento para instituições de memória e <nobreak>coleções particulares</nobreak>"
},
"About": {
"title": "Sobre",
"description": "Trabalhamos com inteligência artificial e padrões abertos na digitalização, catalogação e difusão de obras de arte e documentos históricos na web",
"infrastructure": {
"title": "Infraestrutura IIIF",
"description": "Implementação do Protocolo Internacional para Interoperabilidade de Imagens"
},
"computer-vision": {
"title":"Visão Computacional",
"description": "Detecção de objetos, classificação de conteúdo, transcrição de manuscritos"
}
},
"Team": {
"Anita": {
"name": "Anita Lucchesi",
"role": "Negócios"
},
"Bruno": {
"name": "Bruno Buccalon",
"role": "Design"
},
"Martim": {
"name": "Martim Passos",
"role": "Tecnologia"
},
"Yuri": {
"name": "Yuri Tavares",
"role": "Tecnologia"
}
},
"Partners": {
"title": "Parceiros"
},
"Projects": {
"title": "Projetos",
"tropiiify": {
"title": "tropiiify",
"description": "Plugin para exportar coleções IIIF através do gerenciador de imagens Tropy"
},
"imaginerio": {
"title": "imagineRio",
"description": "Plataforma de mapeamento histórico da cidade do Rio de Janeiro"
}
}
},
"LocaleSwitcher": {
"label": "Mudar idioma",
"locale": "{locale, select, pt {Português} en {English} other {Unknown}}"
}
}
1 change: 0 additions & 1 deletion middleware.js

This file was deleted.

1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
11 changes: 11 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const createNextIntlPlugin = require('next-intl/plugin');
const withNextIntl = createNextIntlPlugin();

module.exports = withNextIntl({
output: 'export',
images: {
unoptimized: true,
},
})


23 changes: 0 additions & 23 deletions next.config.mjs

This file was deleted.

Loading

0 comments on commit 48c57ae

Please sign in to comment.