2.7 Assets folder 2.7 资源文件夹

In Web Development (not just Shopify), “assets” are usually any additional files your website needs besides the actual HTML. Some common types of assets are:

不只是Shopify,我们在做网页开发的时候,“资源”都是除了HTML之外的的一些附属文件。通常有以下几种。

  • CSS files
  • CSS文件
  • Javascript files
  • Javascript 文件
  • Images and icons
  • 图片和图标

ℹ️ Images in the assets folder The images you keep here are those that are part of the theme. Like the cart icon, or social media icons. You would not add things like banner images in the assets folder. These are part of your store content, and you would keep those in Content > Files.

ℹ️资源文件夹里的图片文件  保存在资源文件夹里图片也是Shopify主题的一部分,例如购物车图标或者是社媒图标。但是我们不能在资源文件夹里添加一些类似于banner之类的图片。因为这种文件是店铺内容的一部分,一般保存在内容>文件(Content > Files) 里面

We can retrieve anything in the assets folder with Liquid, by using the asset_url filter:

通过使用Shopify liquid 过滤器,我们可以获取资源文件夹里的任意资源。

{{ 'cart.js' | asset_url }}

 

资源:

https://shopify.dev/docs/api/liquid/filters/asset_url

上一篇 2.8 Locales folder 本地化文件夹
下一篇 Chapter 3: Where to start coding 第三章 Shopify编程从哪里下手?
AeroCore图片
AeroCore图片
AeroCore图片
AeroCore图片
AeroCore图片
最新评论
暂无评论