Skip to content

Commit

Permalink
feat(broadcasts): news dedicated page (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Jun 3, 2024
1 parent b7002e0 commit 1d0eb2e
Show file tree
Hide file tree
Showing 16 changed files with 154 additions and 10 deletions.
1 change: 1 addition & 0 deletions content/broadcasts/230519-amsterdam/index.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ message: |
Aurélie Beguec (project manager) and Sinh Chung Nguyen (architect) from the French
Tax Administration, present TDP and the TOSIT association at the World Data Summit.
when: 17-19 May 2023 Amsterdam, The Netherlands
home: false
1 change: 1 addition & 0 deletions content/broadcasts/230519-amsterdam/index.fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ message: |
générale des finances publiques (DGFiP), présentent TDP et l'association TOSIT au
World Data Summit.
when: 17-19 May 2023 Amsterdam, The Netherlands
home: false
1 change: 1 addition & 0 deletions content/broadcasts/230925-bigdata-ai-paris/index.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ message: |
Presentation of TDP at the Big-Data - AI Paris show (https://www.bigdataparis.com/).
We will be at stand "C46" at the show to welcome you and answer your questions.
when: 8:30 a.m. to 6:00 p.m., 25-26 September 2023, Palais des Congrès, Paris, France
home: false
1 change: 1 addition & 0 deletions content/broadcasts/230925-bigdata-ai-paris/index.fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ message: |
Présentation de TDP au salon Big-Data - AI Paris (https://www.bigdataparis.com/).
Nous serons au stand "C46" du salon pour vous accueillir et répondre à vos questions.
when: 8h30-18h00, 25-26 Septembre 2023, Palais des Congrès, Paris, France
home: false
1 change: 1 addition & 0 deletions content/broadcasts/231115-bigdata-ai-world/index.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ message: |
Presentation of TDP at the Big-Data & AI World show (https://www.bigdataworld.fr/).
We will also have a stand at the show to welcome you and answer your questions.
when: 8:30 a.m. to 6:00 p.m., 15-16 November 2023, Porte de Versailles, Paris, France
home: true
1 change: 1 addition & 0 deletions content/broadcasts/231115-bigdata-ai-world/index.fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ message: |
Nous aurons également un stand au salon pour vous accueillir et répondre à vos
questions.
when: 8h30-18h00, 15-16 Novembre 2023, Porte de Versailles, Paris, France
home: true
2 changes: 2 additions & 0 deletions content/i18ns/index.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ header:
start: Getting started
broadcasts:
title: News and events
browse: Browse all news
reports:
title: TDP contributors meetings
browse: Browse all reports
features:
open:
title: Open Source
Expand Down
4 changes: 3 additions & 1 deletion content/i18ns/index.fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ header:
doc: Documentation
start: Tutoriel
broadcasts:
title: Nouveautés et évènements
title: Actualités et évènements
browse: Toutes les actualités
reports:
title: Compte rendus
browse: Voir plus
features:
open:
title: Open Source
Expand Down
6 changes: 6 additions & 0 deletions content/pages/1.discover/60.news/index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
nav_title: News and events
jsx: true
---

# TDP news and events
7 changes: 7 additions & 0 deletions content/pages/1.discover/60.news/index.fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
nav_title: Actualités et evènements
jsx: true
slug: actualites
---

# TDP actualités et evènements
23 changes: 16 additions & 7 deletions src/app/[lang]/(home)/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default async function Page({ params }) {
...broadcast,
lang: broadcast.lang || 'en',
}))
.filter((broadcast) => broadcast.lang === params.lang)
.filter((broadcast) => broadcast.lang === params.lang && broadcast.data.home === true)
const reports = await redac([
{
module: mdx,
Expand Down Expand Up @@ -213,7 +213,7 @@ export default async function Page({ params }) {
'radial-gradient(43.58% 43.58% at 21.12% 25.63%, rgba(97, 130, 120, 0.2) 0%, rgba(122, 159, 132, 0) 100%), radial-gradient(64.91% 64.91% at 31.32% 63.18%, rgba(64, 86, 142, 0.2) 0%, rgba(0, 0, 0, 0) 100%), radial-gradient(19.81% 43.58% at 73.92% 40.01%, rgba(122, 159, 132, 0.2) 0%, rgba(40, 52, 59, 0.056) 100%), #263134',
}}
>
<Logos/>
<Logos />
<div className="max-w-4xl px-5 m-auto">
{broadcasts.length !== 0 && (
<>
Expand All @@ -239,6 +239,17 @@ export default async function Page({ params }) {
</li>
))}
</ul>
<div className="text-right">
<Link
href={
params.lang === 'fr'
? `/${params.lang}/decouvrir/actualites`
: `/${params.lang}/discover/news`
}
>
{i18n.broadcasts.browse}
</Link>
</div>
</>
)}
{reports.length !== 0 && (
Expand Down Expand Up @@ -275,11 +286,9 @@ export default async function Page({ params }) {
</ul>
{reports.length > 5 && (
<div className="text-right">
<Link
href={`/${
params.lang
}/contribute/develop/reports`}
>Browse all reports</Link>
<Link href={`/${params.lang}/contribute/develop/reports`}>
{i18n.reports.browse}
</Link>
</div>
)}
</>
Expand Down
17 changes: 17 additions & 0 deletions src/app/[lang]/(news)/decouvrir/actualites/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'server-only'
import Page from '../../discover/news/page'

export async function generateMetadata() {
return {
title: 'TDP Actualités et événements',
description: 'Dernières actualités sur TDP et liste des événements passés et à venir.',
}
}

export async function generateStaticParams() {
return [{
lang: 'fr'
}]
}

export default Page
14 changes: 14 additions & 0 deletions src/app/[lang]/(news)/decouvrir/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Layout from '../../(pages)/[...slug]/layout.js'

export default async function newLayout({
children,
params
}) {
return Layout({
children,
params: {
...params,
slug: ['decouvrir', 'actualites']
}
})
}
14 changes: 14 additions & 0 deletions src/app/[lang]/(news)/discover/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Layout from '../../(pages)/[...slug]/layout.js'

export default async function newLayout({
children,
params
}) {
return Layout({
children,
params: {
...params,
slug: ['discover', 'news']
}
})
}
67 changes: 67 additions & 0 deletions src/app/[lang]/(news)/discover/news/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import 'server-only'
import clsx from 'clsx'
import redac from 'redac'
import mdx from 'redac/plugins/mdx'
import yaml from 'redac/plugins/yaml'

export async function generateMetadata() {
return {
title: 'TDP news and events',
description: 'Latest news on TDP and list of past and future events.',
}
}

export async function generateStaticParams() {
return [{
lang: 'en'
}]
}

export default async function Page({ params }) {
const i18n = await redac([
{
module: yaml,
config: './content/i18ns',
},
])
.from('i18ns')
.match(params.lang, [])
.map((params) => params.data)
.get()
const broadcasts = await redac([
{
module: yaml,
config: './content/broadcasts',
},
])
.from('broadcasts')
.map((broadcast) => ({
...broadcast,
lang: broadcast.lang || 'en',
}))
.filter((broadcast) => broadcast.lang === params.lang)
return (
<div className="prose dark:prose-invert max-w-none">
<h1>{i18n.broadcasts.title}</h1>
<ul className="grid gap-3 mb-5 not-prose">
{broadcasts.reverse().map((broadcast) => (
<li
key={broadcast.slug.join('/')}
className={clsx(
'py-2 px-3',
'text-white/70 hover:text-white/100 font-extralight',
'rounded border border-white/40 hover:border-white/80'
)}
style={{
background:
'radial-gradient(50% 50% at 50% 50%, rgba(37, 42, 40, 0.8) 0%, rgba(31, 38, 43, 0.8) 100%)',
}}
>
<p>{broadcast.data.message}</p>
<small>{broadcast.data.when}</small>
</li>
))}
</ul>
</div>
)
}
4 changes: 2 additions & 2 deletions src/app/[lang]/(reports)/contribute/develop/reports/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import redac from 'redac'
import mdx from 'redac/plugins/mdx'
import Link from 'next/link'

export async function generateMetadata({ params }) {
export async function generateMetadata() {
return {
title: 'TDP contributors meetings',
description: 'List of all TDP contributors meeting notes scheduled every Friday.',
}
}

export async function generateStaticParams({ params }) {
export async function generateStaticParams() {
return [{
lang: 'en'
}]
Expand Down

0 comments on commit 1d0eb2e

Please sign in to comment.