Nextra 3.0 已發佈。 閱讀更多

API

useThemeConfig hook

useThemeConfig hook 會回傳您的主題配置的值,並用於動態配置您的專案。

import { useThemeConfig } from 'nextra-theme-docs'

useConfig hook

import { useConfig } from 'nextra-theme-docs'

useConfig hook 會從您目前的頁面上下文回傳資料。

回傳值

  • title:目前頁面的標題
  • frontMatter:已解析的前置資料
  • filePath:目前的 Markdown/MDX 檔案路徑
  • hideSidebar:側邊欄是否隱藏
  • normalizePagesResult: ReturnType<typeof normalizePages>