contentstack-kickstart

作者: contentstack

Contentstack Delivery SDK、環境變數、Live Preview,以及此快速啟動中的種子頁面模型。

npx skills add https://github.com/contentstack/kickstart-next-ssg --skill contentstack-kickstart

Contentstack kickstart – kickstart-next-ssg

When to use

  • Changing how the app fetches or displays CMS content
  • Debugging Live Preview or Visual Builder integration
  • Extending TypeScript types for new fields or content types

Instructions

Entry points

Stack configuration

  • Built with @contentstack/delivery-sdk contentstack.stack({ ... }) using NEXT_PUBLIC_CONTENTSTACK_API_KEY, NEXT_PUBLIC_CONTENTSTACK_DELIVERY_TOKEN, NEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT, and region-related settings.
  • Optional overrides for hosts/CDN (internal or custom): NEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY, NEXT_PUBLIC_CONTENTSTACK_PREVIEW_HOST, NEXT_PUBLIC_CONTENTSTACK_CONTENT_APPLICATION, NEXT_PUBLIC_CONTENTSTACK_PREVIEW (boolean string), NEXT_PUBLIC_CONTENTSTACK_PREVIEW_TOKEN.
  • Region resolution uses helpers from @timbenniks/contentstack-endpoints aligned with NEXT_PUBLIC_CONTENTSTACK_REGION.

Fetching content

  • getPage(url) queries content type page, field url, equality match via QueryOperation.EQUALS, then returns the first entry.
  • When NEXT_PUBLIC_CONTENTSTACK_PREVIEW === 'true', contentstack.Utils.addEditableTags is applied to the entry for in-editor overlays.

Live Preview (client)

  • pages/index.tsx: initLivePreview() runs in useEffect; ContentstackLivePreview.onEntryChange refetches the home page so the UI updates in preview.
  • initLivePreview in lib/contentstack.ts uses @contentstack/live-preview-utils with mode: "builder", stack details from env, optional application host from env/endpoints, and edit button enabled (with outsideLivePreviewPortal excluded).

Seeded stack and tokens

  • CLI seed and token setup are documented in root README.md (delivery token with preview scope, Live Preview environment).

Images and URLs

  • Remote image hostnames for next/image are configured in next.config.mjs; optional NEXT_PUBLIC_CONTENTSTACK_IMAGE_HOSTNAME narrows or replaces defaults.

來自 contentstack 的更多技能

cms-assets
contentstack
為開發人員提供有關在Contentstack中組織、交付和轉換資產的建議。涵蓋資料夾結構、Image Delivery API轉換、發佈……
cms-branches-aliases
contentstack
為開發人員提供使用 Contentstack 分支進行隔離內容開發以及使用別名實現零停機內容部署的建議。涵蓋分支策略,…
cms-data-modeling-best-practices
contentstack
引導開發人員在Contentstack中使用最簡單的可重用結構來建模內容。此技能說明何時使用內容類型、引用、全域…
cms-live-preview-visual-builder-support-assistant
contentstack
診斷並指導 Contentstack Live Preview 和 Visual Builder 的實作。追蹤預覽上下文,識別中斷的合約,並建議…
cms-releases
contentstack
指導開發人員使用 Contentstack Releases 進行協調、原子化的內容部署。涵蓋版本建立、項目管理、分階段部署等內容。
cms-roles-permissions
contentstack
為開發人員提供關於在Contentstack中設計角色、權限、團隊和Token存取權限的建議。解釋內建角色、自訂角色、權限合併等。
cms-taxonomy
contentstack
為開發人員提供關於使用 Contentstack Taxonomy 進行結構化、階層式內容分類及傳遞端篩選的建議。涵蓋 taxonomy 與 tags 的比較,…
cms-tokens-authentication
contentstack
為開發人員提供建議,協助他們為前端、後端、自動化及第三方應用程式使用情境選擇正確的Contentstack驗證方法與權杖類型。…