Skip to content

Commit

Permalink
use article as a string instead of an array of string
Browse files Browse the repository at this point in the history
  • Loading branch information
samithaf committed Oct 25, 2023
1 parent 22965ef commit c615169
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/site/src/app/articles/[...article]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ export function generateMetadata({ params }: { params: { article: string } }) {
return { title: formatComponentSlug(article[article.length - 1]) };
}

export default async function ArticleServerPage({ params }: { params: { article: string[] } }) {
export default async function ArticleServerPage({ params }: { params: { article: string } }) {
const { article: articleParam } = params;
console.log(`articleParam.join('/')`, articleParam.join('/'));
const article = await reader.collections.articles.readOrThrow(articleParam.join('/'));
const article = await reader.collections.articles.readOrThrow(articleParam);

const [articleContent, author] = await Promise.all([
article.content(),
Expand Down

0 comments on commit c615169

Please sign in to comment.