-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On continue dans next-yak mais il y a plein de problèmes...
- Loading branch information
Showing
11 changed files
with
140 additions
and
126 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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import ArticleWrapper from '@/components/ArticleUI' | ||
import BlueskyComments from '@/components/BlueskyComments' | ||
import { getMDXComponent } from 'next-contentlayer2/hooks' | ||
import { css } from 'next-yak' | ||
import Image from 'next/image' | ||
import Link from 'next/link' | ||
import Contribution from '@/app/blog/Contribution' | ||
import OtherArticles from './OtherArticles' | ||
import { mdxComponents } from './mdxComponents' | ||
import { dateCool, getLastEdit } from './utils' | ||
|
||
export default async function Article({ post, slug }) { | ||
const MDXContent = getMDXComponent(post.body.code) | ||
const lastEdit = await getLastEdit(slug) | ||
|
||
const sameEditDate = | ||
!lastEdit || post.date.slice(0, 10) === lastEdit.slice(0, 10) | ||
return ( | ||
<div> | ||
<ArticleWrapper> | ||
{!post.tags?.includes('page') && ( | ||
<Link | ||
href="/blog" | ||
css={css` | ||
margin-top: 0.6rem; | ||
display: inline-block; | ||
`} | ||
> | ||
← Retour au blog | ||
</Link> | ||
)} | ||
<header> | ||
{post.image && ( | ||
<Image | ||
src={post.image} | ||
width="600" | ||
height="400" | ||
alt="Illustration de l'article" | ||
/> | ||
)} | ||
<h1 dangerouslySetInnerHTML={{ __html: post.titre.html }} /> | ||
<p>{post?.description}</p> | ||
<small> | ||
publié le <time dateTime={post.date}>{dateCool(post.date)}</time> | ||
{!sameEditDate && ( | ||
<span> | ||
, mis à jour{' '} | ||
<time dateTime={lastEdit}>{dateCool(lastEdit)}</time> | ||
</span> | ||
)} | ||
</small> | ||
<hr /> | ||
</header> | ||
<MDXContent components={mdxComponents} /> | ||
<Contribution slug={params.slug} /> | ||
<OtherArticles excludeUrl={post.url} /> | ||
</ArticleWrapper> | ||
{post?.bluesky && <BlueskyComments uri={post.bluesky} />} | ||
</div> | ||
) | ||
} |
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,58 @@ | ||
import Logo from '@/public/logo.svg' | ||
import { css } from 'next-yak' | ||
import Image from 'next/image' | ||
import Link from 'next/link' | ||
import { List } from './UI' | ||
import { dateCool } from './utils' | ||
|
||
export const description = | ||
"Découvrez l'histoire, les nouveautés et le futur de Cartes.app" | ||
|
||
export default function Blog({ articles }) { | ||
return ( | ||
<main> | ||
<nav | ||
css={css` | ||
margin-top: 1rem; | ||
`} | ||
> | ||
<Link href="/"> | ||
<Image | ||
src={Logo} | ||
alt="Logo de Cartes.app" | ||
width="100" | ||
height="100" | ||
css={css` | ||
width: 2rem; | ||
height: auto; | ||
margin-right: 0.6rem; | ||
vertical-align: middle; | ||
`} | ||
/> | ||
Revenir sur la carte | ||
</Link> | ||
</nav> | ||
<h1>Le blog de Cartes.app</h1> | ||
<p>{description}</p> | ||
<p> | ||
Pour l'instant, nous sommes dans une phase de construction : l'objectif | ||
est de sortir une version 1 en 2024, et ces articles en expliquent | ||
l'avancement. L'application reste largement utilisable, mais | ||
attendez-vous à quelques bugs. | ||
</p> | ||
<List> | ||
{articles.map(({ url, date, titre }) => ( | ||
<li key={url}> | ||
<div> | ||
<Link | ||
href={url} | ||
dangerouslySetInnerHTML={{ __html: titre.html }} | ||
/> | ||
</div> | ||
<small>publié le {dateCool(date)}</small> | ||
</li> | ||
))} | ||
</List> | ||
</main> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { allArticles } from '@/.contentlayer/generated' | ||
|
||
export const blogArticles = allArticles.filter( | ||
(article) => | ||
!article.tags?.includes('page') && !article.tags?.includes('brouillon') | ||
) |
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,76 +1,19 @@ | ||
import { allArticles } from '@/.contentlayer/generated' | ||
import { compareDesc } from 'date-fns' | ||
import Link from 'next/link' | ||
import { List } from './UI' | ||
import { dateCool } from './utils' | ||
import Logo from '@/public/logo.svg' | ||
import Image from 'next/image' | ||
import {css} from 'next-yak' | ||
|
||
export const blogArticles = allArticles.filter( | ||
(article) => | ||
!article.tags?.includes('page') && !article.tags?.includes('brouillon') | ||
) | ||
import { blogArticles } from './blogArticles' | ||
import Blog from './Blog' | ||
|
||
const title = `Le blog - Cartes` | ||
const description = | ||
"Découvrez l'histoire, les nouveautés et le futur de Cartes.app" | ||
|
||
export const metadata: metadata = { | ||
title, | ||
description, | ||
description: 'yoyo', | ||
} | ||
|
||
const Page = () => { | ||
const articles = blogArticles.sort((a, b) => | ||
compareDesc(new Date(a.date), new Date(b.date)) | ||
) | ||
return ( | ||
<main> | ||
<nav | ||
css={css` | ||
margin-top: 1rem; | ||
`} | ||
> | ||
<Link href="/"> | ||
<Image | ||
src={Logo} | ||
alt="Logo de Cartes.app" | ||
width="100" | ||
height="100" | ||
css={css` | ||
width: 2rem; | ||
height: auto; | ||
margin-right: 0.6rem; | ||
vertical-align: middle; | ||
`} | ||
/> | ||
Revenir sur la carte | ||
</Link> | ||
</nav> | ||
<h1>Le blog de Cartes.app</h1> | ||
<p>{description}</p> | ||
<p> | ||
Pour l'instant, nous sommes dans une phase de construction : l'objectif | ||
est de sortir une version 1 en 2024, et ces articles en expliquent | ||
l'avancement. L'application reste largement utilisable, mais | ||
attendez-vous à quelques bugs. | ||
</p> | ||
<List> | ||
{articles.map(({ url, date, titre }) => ( | ||
<li key={url}> | ||
<div> | ||
<Link | ||
href={url} | ||
dangerouslySetInnerHTML={{ __html: titre.html }} | ||
/> | ||
</div> | ||
<small>publié le {dateCool(date)}</small> | ||
</li> | ||
))} | ||
</List> | ||
</main> | ||
) | ||
return <Blog articles={articles} /> | ||
} | ||
|
||
export default Page |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// postcss.config.js | ||
module.exports = { | ||
plugins: { | ||
'postcss-nested': {}, | ||
}, | ||
} |