Understanding and using the built-in blog functionality in ShadcnKit
app/content/article.ts
: Defines the structure of blog postsapp/content/articles/
: Contains individual article contentapp/[locale]/blog/[slug]/page.tsx
: Dynamic route for individual blog postsapp/[locale]/blog/page.tsx
: Blog index pageapp/content/functions/get-all-slugs.ts
: Generates slugs for all blog postsapp/content/functions/get-blog-slug.ts
: Retrieves blog posts by slugapp/sitemap.ts
: Generates a sitemap for your blogapp/robots.ts
: Configures robots.txt for search enginesarticle.ts
with multilingual support.
[slug]
and [locale]
parameters in the file structure enable dynamic routing for different languages and blog posts.
getBlogs
function fetches the appropriate content based on the slug and locale.
app/content/articles/
for your blog post content.blogs
array in app/content/article.ts
.en.json
, fr.json
, ar.json
).[locale]
parameter in the URL determines the displayed language.messages
directory.app/content/articles/
:app/content/article.ts
:/[locale]/blog/your-blog-post-slug
and included in the sitemap.