我要学习 YAML 数据序列化语言,我想根据一个 YAML 脚本来回答这些问题。什么是正确的答案?
我已经学习了一些 JSON,但是为了区分 YAML 和 JSON 并了解 YAML,我发现这个脚本带有这些问题。
{% if country('ae') %}
data:
- debug: false
modules:
- type: bannerModule
numPerRow: 1
externalexternalLink: true
banners:
- linkUrl: https://www.mi.com/en/about/
imageUrl: IMAGE_BASE/{{lang()}}_banner-01.png
- type: bannerModule
numPerRow: 2
banners:
- linkUrl: "/electronics-and-mobiles/mobiles-and-accessories/mobiles-20905/xiaomi"
imageUrl: IMAGE_BASE/{{lang()}}_cat-module-01.png
- linkUrl: "/electronics-and-mobiles/wearable-technology/xiaomi"
imageUrl: IMAGE_BASE/{{lang()}}_cat-module-02.png
- linkUrl: "/home-and-kitchen/xiaomi"
imageUrl: IMAGE_BASE/{{lang()}}_cat-module-03.png
#linkUrl: "/electronics-and-mobiles/mobiles-and-accessories/accessories-16176/bluetooth-speakers/xiaomi?sort[by]=price&sort[dir]=desc"
#imageUrl: IMAGE_BASE/{{lang()}}_cat-module-04.png
- modules:
- type: bannerModule
numPerRow: 6
moduleHeader:
titleText: {% if lang('en') %}Shop By Category{% else %}تسوق حسب الفئة{% endif %}
banners:
- linkUrl: "electronics-and-mobiles/mobiles-and-accessories/mobiles-20905/xiaomi"
imageUrl: IMAGE_BASE/en_category-01.png
titleText: {% if lang('en') %}Mobiles{% else %}الجوّالات{% endif %}
- linkUrl: "/electronics-and-mobiles/mobiles-and-accessories/accessories-16176/xiaomi"
imageUrl: IMAGE_BASE/en_category-02.png
titleText: {% if lang('en') %}Accessories{% else %}الإكسسوارات{% endif %}
- linkUrl: "/electronics-and-mobiles/wearable-technology/xiaomi"
imageUrl: IMAGE_BASE/en_category-03.png
titleText: {% if lang('en') %}Wearables{% else %}ساعات وأساور تتبع اللياقة{% endif %}
- linkUrl: "/electronics-and-mobiles/television-and-video/xiaomi"
imageUrl: IMAGE_BASE/en_category-04.png
titleText: {% if lang('en') %}Audio Video{% else %}أجهزة الصوت والفيديو{% endif %}
- linkUrl: "home-and-kitchen/xiaomi"
imageUrl: IMAGE_BASE/en_category-05.png
titleText: {% if lang('en') %}Home & Kitchen{% else %}أجهزة المنزل والمطبخ{% endif %}
- linkUrl: "/xiaomi"
imageUrl: IMAGE_BASE/{{lang()}}_category-06.png
titleText: {% if lang('en') %}View All{% else %}عرض الكل{% endif %}
{% endif %}
{% if country('sa') %}
data:
- debug: false
modules:
- type: bannerModule
numPerRow: 1
externalexternalLink: true
banners:
- linkUrl: "/https://www.mi.com/en/about/"
imageUrl: IMAGE_BASE/{{lang()}}_banner-01.png
- type: bannerModule
numPerRow: 2
banners:
- linkUrl: "/electronics-and-mobiles/mobiles-and-accessories/mobiles-20905/xiaomi"
imageUrl: IMAGE_BASE/{{lang()}}_cat-module-01.png
- linkUrl: "/electronics-and-mobiles/wearable-technology/xiaomi"
imageUrl: IMAGE_BASE/{{lang()}}_cat-module-02.png
- linkUrl: "/home-and-kitchen/xiaomi"
imageUrl: IMAGE_BASE/{{lang()}}_cat-module-03.png
- linkUrl: "/electronics-and-mobiles/mobiles-and-accessories/accessories-16176/bluetooth-speakers/xiaomi?sort[by]=price&sort[dir]=desc"
imageUrl: IMAGE_BASE/{{lang()}}_cat-module-04.png
{% endif %}
- 什么yml条件设置页面的国家选择行为?
- 对于第一条横幅,第一行将显示多少条横幅?
- 音频视频页面设置了什么链接?
- 这是
en_category-01.png
什么,这个图像是关于什么的? - 此示例页面中有多少个类别横幅?
- 沙特页面上有多少条横幅?
- 单击时向用户显示哪个页面
banner-01.png
? - 此 yml 文件上的两个链接格式错误,导致单击分配给它的横幅时出现 404 页面。那些横幅是什么?
- 此 yml 文件中的一个横幅未激活,那是哪个横幅?