ডকসDocumentationMdxFrontmatter

Frontmatter

MDX ফাইলে frontmatter কীভাবে ব্যবহার করতে হয় শিখুন।

frontmatter একটি MDX ফাইলের গুরুত্বপূর্ণ অংশ। এটি ফাইলের content সম্পর্কে তথ্য define করতে ব্যবহৃত হয়, যেমন title, description, author, publication date ইত্যাদি।

metadata header ফাইলের শুরুতে থাকে এবং শুরু ও শেষে --- (তিনটি hyphen)-এর মধ্যে লেখা হয়।

Format

metadata header key-value format-এ define করা হয়, যেখানে key হলো metadata-এর নাম এবং value হলো metadata-এর content।

উদাহরণ:

---
title: Document title
description: Document description
---

ডকুমেন্টের ধরন অনুযায়ী (documentation, blog post ইত্যাদি) ভিন্ন metadata ব্যবহার করা যায়।

Documentation-এর metadata

  • title
  • description
  • links
    • source
    • docs
    • blog
    • api

উদাহরণ:

---
title: Document title
description: Document description
links:
  source: https://google.com
  docs: /docs
  blog: /blog
  api: https://google.com
---

Blog post-এর metadata

  • title
  • excerpt
  • date
  • author_id
  • og_image
  • tags
  • links
    • source
    • docs
    • blog
    • api

উদাহরণ:

---
title: Post title
date: 2024-08-07 22:33:00
excerpt: Post excerpt
author_id: daltonmenezes
og_image: introducing-blogs-og.jpg
links:
  source: https://google.com
  docs: /docs
  blog: /blog
  api: https://google.com
tags: [next.js, open-graph, blog]
---