డాక్స్DocumentationMdxFrontmatter

Frontmatter ఉపయోగించడం

MDX ఫైల్‌లలో frontmatter ఎలా ఉపయోగించాలో తెలుసుకోండి.

frontmatter అనేది MDX ఫైల్‌లో ముఖ్యమైన భాగం. ఫైల్‌లోని కంటెంట్ గురించి title, description, author, publication date వంటి సమాచారాన్ని నిర్వచించడానికి ఇది ఉపయోగించబడుతుంది.

మెటాడేటా హెడర్ ఫైల్ ప్రారంభంలో, ప్రారంభం మరియు ముగింపులో --- (మూడు hyphens) మధ్య నిర్వచించబడుతుంది.

ఫార్మాట్

మెటాడేటా హెడర్ key-value ఫార్మాట్‌లో నిర్వచించబడుతుంది; key అంటే మెటాడేటా పేరు, value అంటే ఆ మెటాడేటా యొక్క కంటెంట్.

ఉదాహరణ:

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

పత్ర రకాన్ని బట్టి (documentation, blog post మొదలైనవి), వేర్వేరు మెటాడేటా ఉపయోగించవచ్చు.

డాక్యుమెంటేషన్ కోసం మెటాడేటా

  • 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
---

బ్లాగ్ పోస్టుల కోసం మెటాడేటా

  • 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]
---