enable-shopify-menus

द्वारा vercel

हार्डकोडेड नेव और फुटर मेन्यू को Shopify-संचालित मेन्यू से बदलें।

npx skills add https://github.com/vercel/shop --skill enable-shopify-menus

Enable Shopify Menus

By default, the storefront's nav and footer render hardcoded items from shopConfig.navigation in shop.config.ts. The components themselves (QuickLinks, MobileMenu, Footer's FooterMenu) already consume MenuItem[] in Shopify shape and render up to three levels of nesting. This skill swaps the data source from shopConfig.navigation.nav / shopConfig.navigation.footer to a live Shopify menu fetched by handle, with a fallback to the hardcoded items if the menu is missing or empty.

Before you start

Ask the user two questions in order:

1. Which menus do you want to fetch from Shopify?

  • Nav menu — replaces the hardcoded items used by the desktop quick links and mobile sheet.
  • Footer menu — replaces the hardcoded footer columns.
  • Both

2. What are the Shopify menu handles?

Ask for each selected menu. Defaults: main-menu for nav, footer for footer.

Wait for the user to answer before proceeding.


Part A: Enable Shopify nav menu

Skip this section if the user did not select the nav menu.

Edit components/nav/index.tsx. Add the getMenu import and swap the data source:

import { getMenu } from "@/lib/shopify/operations/menu";

Inside Nav, replace const items = shopConfig.navigation.nav; with:

const menu = await getMenu({ handle: "NAV_HANDLE" });
const items = menu?.items ?? shopConfig.navigation.nav;

Replace "NAV_HANDLE" with the handle the user provided. QuickLinks and MobileMenu already accept MenuItem[], so no other component changes are needed. Keep shopConfig.navigation.nav as the fallback.


Part B: Enable Shopify footer menu

Skip this section if the user did not select the footer menu.

Edit components/footer/index.tsx. Make the component async, add the getMenu import, and swap the data source:

import { getMenu } from "@/lib/shopify/operations/menu";

Change the signature to async and replace const items = shopConfig.navigation.footer; with:

const menu = await getMenu({ handle: "FOOTER_HANDLE" });
const items = menu?.items ?? shopConfig.navigation.footer;

Replace "FOOTER_HANDLE" with the handle the user provided. FooterMenu already accepts MenuItem[]. Keep shopConfig.navigation.footer as the fallback.

The Footer callsite in app/layout.tsx (or wherever it is rendered) already passes locale; if it is not wrapped in <Suspense>, the menu fetch will block layout render — that is acceptable since getMenu is cached with "use cache: remote" and cacheLife("max"). Wrap in <Suspense> only if you specifically want the rest of the page to stream ahead of the footer.


Guardrails

  • The getMenu() operation in lib/shopify/operations/menu.ts already handles caching ("use cache: remote", cacheTag("menus")) and URL transformation. Do not duplicate that logic.
  • Always preserve the shopConfig.navigation.nav / shopConfig.navigation.footer fallback so a missing or empty Shopify menu doesn't leave the user with a blank nav or footer.
  • External links (URLs starting with http) are handled by the existing MenuLink helpers in each component — no change needed.

vercel की और Skills

benchmark-sandbox
vercel
Vercel Sandboxes में vercel-plugin eval परिदृश्य चलाएँ, स्थानीय WezTerm पैनलों के बजाय। Claude Code + प्लगइन पूर्व-स्थापित के साथ अस्थायी microVMs प्रदान करता है,…
official
emil-design-eng
vercel
यह कौशल एमिल कोवाल्स्की के UI पॉलिश, कंपोनेंट डिज़ाइन, एनिमेशन निर्णयों और उन अदृश्य विवरणों पर दर्शन को एनकोड करता है जो सॉफ्टवेयर को शानदार महसूस कराते हैं।
official
vercel-react-best-practices
vercel
React और Next.js प्रदर्शन अनुकूलन दिशानिर्देश Vercel Engineering से। इस कौशल का उपयोग React/Next.js कोड लिखने, समीक्षा करने या रीफैक्टर करते समय किया जाना चाहिए…
official
vercel-react-best-practices
vercel
React और Next.js प्रदर्शन अनुकूलन दिशानिर्देश Vercel Engineering से। इस कौशल का उपयोग React/Next.js को लिखने, समीक्षा करने या रीफैक्टर करने के दौरान किया जाना चाहिए…
official
write-guide
vercel
एक तकनीकी गाइड तैयार करें जो प्रगतिशील उदाहरणों के माध्यम से एक वास्तविक दुनिया के उपयोग के मामले को सिखाता है। अवधारणाओं को केवल तब पेश किया जाता है जब पाठक को उनकी आवश्यकता होती है।
official
release
vercel
वर्सेल-प्लगइन जारी करें — गेट्स चलाएं, संस्करण बढ़ाएं, आर्टिफैक्ट्स उत्पन्न करें, कमिट करें और पुश करें। जब "रिलीज़ करें", "शिप करें", "बंप और पुश करें" या "कट अ रिलीज़" कहा जाए तो इसका उपयोग करें।
official
deepsec
vercel
dev3000 से Vercel प्रोजेक्ट चेकआउट पर DeepSec चलाएँ। एक-क्लिक DeepSec सेटअप, प्रोजेक्ट संदर्भ बूटस्ट्रैपिंग, सीमित प्रथम-पास प्रसंस्करण, और… के लिए उपयोग करें।
official
backport-pr
vercel
किसी मर्ज किए गए Next.js पुल रिक्वेस्ट को canary से पिछली रिलीज़ ब्रांच जैसे next-16-2 पर बैकपोर्ट करें। तब उपयोग करें जब उपयोगकर्ता बैकपोर्ट, चेरी-पिक, या खोलने के लिए कहे…
official