shopify-content by jezweb/claude-skills
npx skills add https://github.com/jezweb/claude-skills --skill shopify-content创建和管理 Shopify 商店内容 —— 页面、博客文章、导航菜单和 SEO 元数据。通过 Admin API 或浏览器自动化在商店中生成实时内容。
read_content、write_content 权限范围的 Admin API 访问令牌(使用 shopify-setup 技能)read_online_store_navigation、write_online_store_navigation 权限范围| 内容类型 | API 支持 | 方法 |
|---|---|---|
| 页面 | 完全支持 | GraphQL Admin API |
| 博客文章 | 完全支持 | GraphQL Admin API |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 导航菜单 | 有限支持 | 首选浏览器自动化 |
| 重定向 | 完全支持 | REST Admin API |
| SEO 元数据 | 按资源支持 | 资源的 GraphQL |
| 元对象 | 完全支持 | GraphQL Admin API |
curl -s https://{store}/admin/api/2025-01/graphql.json \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: {token}" \
-d '{
"query": "mutation pageCreate($page: PageCreateInput!) { pageCreate(page: $page) { page { id title handle } userErrors { field message } } }",
"variables": {
"page": {
"title": "About Us",
"handle": "about",
"body": "<h2>Our Story</h2><p>Content here...</p>",
"isPublished": true,
"seo": {
"title": "About Us | Store Name",
"description": "Learn about our story and mission."
}
}
}
}'
页面正文 接受 HTML。请保持语义化:
<h2> 到 <h6> 作为标题(页面标题是 <h1>)<p>、<ul>、<ol> 作为正文文本<a href="..."> 作为链接Shopify 博客采用两级结构:博客(容器)> 文章(帖子)。
查找或创建博客:
{
blogs(first: 10) {
edges {
node { id title handle }
}
}
}
大多数商店都有一个名为 "News" 的默认博客。在其中创建文章:
mutation {
articleCreate(article: {
blogId: "gid://shopify/Blog/123"
title: "New Product Launch"
handle: "new-product-launch"
contentHtml: "<p>We're excited to announce...</p>"
author: { name: "Store Team" }
tags: ["news", "products"]
isPublished: true
publishDate: "2026-02-22T00:00:00Z"
seo: {
title: "New Product Launch | Store Name"
description: "Announcing our latest product range."
}
image: {
src: "https://example.com/blog-image.jpg"
altText: "New product collection"
}
}) {
article { id title handle }
userErrors { field message }
}
}
导航菜单的 API 支持有限。请使用浏览器自动化:
https://{store}.myshopify.com/admin/menus或者,如果 API 版本支持,可以使用 GraphQL menuUpdate 变更:
mutation menuUpdate($id: ID!, $items: [MenuItemInput!]!) {
menuUpdate(id: $id, items: $items) {
menu { id title }
userErrors { field message }
}
}
URL 重定向使用 REST API:
curl -s https://{store}/admin/api/2025-01/redirects.json \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: {token}" \
-d '{
"redirect": {
"path": "/old-page",
"target": "/new-page"
}
}'
SEO 字段位于每个资源(产品、页面、文章)上。通过资源的变更操作进行更新:
mutation {
pageUpdate(page: {
id: "gid://shopify/Page/123"
seo: {
title: "Updated SEO Title"
description: "Updated meta description under 160 chars."
}
}) {
page { id title }
userErrors { field message }
}
}
查询回内容以确认:
{
pages(first: 10, reverse: true) {
edges {
node { id title handle isPublished createdAt }
}
}
}
提供管理后台 URL 和实时 URL 供用户查看:
https://{store}.myshopify.com/admin/pageshttps://{store}.myshopify.com/pages/{handle}对于简单内容(关于我们、联系我们、常见问题),使用页面。对于结构化、可重复的内容(团队成员、推荐信、地点),使用元对象 —— 它们具有类型化字段,并且可以通过编程方式查询。
每篇博客文章都应包含:
在文章上使用 publishDate 进行定时发布。页面在 isPublished: true 时立即发布。
对于大量页面(例如地点页面、服务页面),请使用带有速率限制的循环:
for page in pages_data:
create_page(page)
sleep(0.5) # 遵守速率限制
references/content-types.md —— API 端点、元对象模式和仅限浏览器的操作每周安装数
328
代码仓库
GitHub 星标数
650
首次出现
2026年2月22日
安全审计
安装于
gemini-cli295
codex295
opencode295
github-copilot294
kimi-cli293
cursor293
Create and manage Shopify store content — pages, blog posts, navigation menus, and SEO metadata. Produces live content in the store via the Admin API or browser automation.
read_content, write_content scopes (use shopify-setup skill)read_online_store_navigation, write_online_store_navigation scopes| Content Type | API Support | Method |
|---|---|---|
| Pages | Full | GraphQL Admin API |
| Blog posts | Full | GraphQL Admin API |
| Navigation menus | Limited | Browser automation preferred |
| Redirects | Full | REST Admin API |
| SEO metadata | Per-resource | GraphQL on the resource |
| Metaobjects | Full | GraphQL Admin API |
curl -s https://{store}/admin/api/2025-01/graphql.json \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: {token}" \
-d '{
"query": "mutation pageCreate($page: PageCreateInput!) { pageCreate(page: $page) { page { id title handle } userErrors { field message } } }",
"variables": {
"page": {
"title": "About Us",
"handle": "about",
"body": "<h2>Our Story</h2><p>Content here...</p>",
"isPublished": true,
"seo": {
"title": "About Us | Store Name",
"description": "Learn about our story and mission."
}
}
}
}'
Page body accepts HTML. Keep it semantic:
<h2> through <h6> for headings (the page title is <h1>)<p>, <ul>, <ol> for body text<a href="..."> for linksShopify blogs have a two-level structure: Blog (container) > Article (post).
Find or create a blog :
{
blogs(first: 10) {
edges {
node { id title handle }
}
}
}
Most stores have a default blog called "News". Create articles in it:
mutation {
articleCreate(article: {
blogId: "gid://shopify/Blog/123"
title: "New Product Launch"
handle: "new-product-launch"
contentHtml: "<p>We're excited to announce...</p>"
author: { name: "Store Team" }
tags: ["news", "products"]
isPublished: true
publishDate: "2026-02-22T00:00:00Z"
seo: {
title: "New Product Launch | Store Name"
description: "Announcing our latest product range."
}
image: {
src: "https://example.com/blog-image.jpg"
altText: "New product collection"
}
}) {
article { id title handle }
userErrors { field message }
}
}
Navigation menus have limited API support. Use browser automation:
https://{store}.myshopify.com/admin/menusAlternatively, use the GraphQL menuUpdate mutation if the API version supports it:
mutation menuUpdate($id: ID!, $items: [MenuItemInput!]!) {
menuUpdate(id: $id, items: $items) {
menu { id title }
userErrors { field message }
}
}
URL redirects use the REST API:
curl -s https://{store}/admin/api/2025-01/redirects.json \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: {token}" \
-d '{
"redirect": {
"path": "/old-page",
"target": "/new-page"
}
}'
SEO fields are on each resource (product, page, article). Update via the resource's mutation:
mutation {
pageUpdate(page: {
id: "gid://shopify/Page/123"
seo: {
title: "Updated SEO Title"
description: "Updated meta description under 160 chars."
}
}) {
page { id title }
userErrors { field message }
}
}
Query back the content to confirm:
{
pages(first: 10, reverse: true) {
edges {
node { id title handle isPublished createdAt }
}
}
}
Provide the admin URL and the live URL for the user to review:
https://{store}.myshopify.com/admin/pageshttps://{store}.myshopify.com/pages/{handle}For simple content (About, Contact, FAQ), use pages. For structured, repeatable content (team members, testimonials, locations), use metaobjects — they have typed fields and can be queried programmatically.
Every blog post should have:
Use publishDate on articles for scheduled publishing. Pages publish immediately when isPublished: true.
For many pages (e.g. location pages, service pages), use a loop with rate limiting:
for page in pages_data:
create_page(page)
sleep(0.5) # Respect rate limits
references/content-types.md — API endpoints, metaobject patterns, and browser-only operationsWeekly Installs
328
Repository
GitHub Stars
650
First Seen
Feb 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
gemini-cli295
codex295
opencode295
github-copilot294
kimi-cli293
cursor293
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
19,000 周安装