Shopify本地开发环境配置

1. 安装themeKit

参考文档:Getting started with Theme Kit

按装教程参考文档即可,归纳如下:

Windows:

1. 安装 choco 命令行
https://chocolatey.org/install#individual

powershell中执行命令
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

2. 安装themeKit
choco install themekit

Linux:

curl -s https://shopify.dev/themekit.py | sudo python3

macOS:

brew tap shopify/shopify
brew install themekit

2. 如何获取到代码权限,便捷开发

2.1 主题编辑有多种方式可以获取到编辑权限:
  • 账号密码(密码暴露不安全)
  • 使用【自定义APP】 (官方不推荐)
  • 使用【主题访问应用程序】(官方推荐)

2.2 安装【主题访问应用程序】
  1. 转到Shopify App Store上的Theme Access应用页面。
  2. Theme Access应用程序页面上,单击添加应用程序
  3. 在您的 Shopify 后台中,要授权使用该应用,请单击安装应用

安装该应用后,您可以从Shopify 后台的应用页面查看和使用它。

2.3 具体操作如下图所示:
  1. 安装Theme Access App

  1. 点击创建密码

  1. 录入开发人员信息,并创建密码,密码会以邮件的形式发送给开发人员

3 使用themeKit进行开发

3.1 在项目目录下创建文件,然后依次填写我们需要的内容信息(下面文件是博主常用的配置项,基本够用)

config.yml:

development:
  password: shptka_xxxxxxxx
  theme_id: "123456"
  store: xxxxxx.myshopify.com
  ignore_files:
  - '*.gif'
  - '*.jpg'

具体配置参考:Theme Kit configuration referenceFamiliarize yourself with the configuration variables available and their accepted values.icon-default.png?t=N7T8https://shopify.dev/themes/tools/theme-kit/configuration-reference#config-file

3.2 进入到文件目录, 执行命名,获取项目代码

获取代码:

theme get

3.3 监听文件变动,自动上传更新

非线上发布主题:theme watch

线上发布主题: theme watch --allow-live

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值