如何理解YAML脚本来回答问题?

时间:2019-03-29 11:13:10

标签: json yaml datastore human-readable data-serialization

我将学习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 %}

  1. 什么yml条件设置页面的国家/地区选择行为?
  2. 对于第一个横幅,第一行将显示多少个横幅?
  3. 为“音频视频”页面设置了什么链接?
  4. en_category-01.png是什么,这张图片是关于什么的?
  5. 此示例页面中有多少个类别标语?
  6. 沙特页面上有多少条横幅?
  7. 单击banner-01.png会向用户显示哪个页面?
  8. 此yml文件上的两个链接格式错误,导致在点击分配给它的标题时出现404页面。这些是哪些横幅?
  9. 此yml文件中没有一个横幅处于活动状态,那是哪个横幅?

0 个答案:

没有答案