透過 100 多個技巧的集合來學習 Nuxt!

sanity
@nuxtjs/sanity

透過 Nuxt 和 Sanity 無頭 CMS 存取文字、圖片和其他媒體。

@nuxtjs/sanity

Nuxt Sanity

npm versionnpm downloadsCodecovLicenseNuxtVolta

SanityNuxt 的整合

功能

  • 只需帶上您的 sanity.config.ts - 無需額外配置
  • 超輕量 Sanity 客戶端
  • 零配置圖片/檔案元件 + 可移植文字渲染器
  • 支援 GROQ 語法高亮顯示
  • 支援 Nuxt 3 和 Nuxt Bridge

📖  閱讀更多

快速設定

  1. @nuxtjs/sanity 依賴項新增至您的專案
npx nuxi@latest module add sanity
  1. @nuxtjs/sanity 新增至 nuxt.config.tsmodules 區段
{
  modules: [
    '@nuxtjs/sanity',
  ],
  sanity: {
    // module options
  }
}

注意:若要在沒有 Bridge 的情況下支援 Nuxt 2,請安裝 @nuxtjs/sanity@0.10.0 並按照 https://v0.sanity.nuxtjs.org 上的指示操作。

開發

  1. 複製此儲存庫
  2. 使用 pnpm install 安裝依賴項
  3. 使用 pnpm dev:prepare 存根模組
  4. 使用 pnpm dev 啟動開發伺服器

授權

MIT 授權