{% set OGType = "article" %}
{% if subtitle is defined and subtitle is not empty %}
{% set titleTag = subtitle %}
{% elseif title is defined and title is not empty %}
{% set titleTag = title %}
{% endif %}
{% if titleTag == "TOPページ" %}
{% set titleTag = "" %}
{% set OGType = "website" %}
{% endif %}
{% if titleTag %}
{% set titleTag = titleTag~" | " %}
{% endif %}
<title>{{ titleTag }}{{ BaseInfo.shop_name }}</title>
{% if Page.author is not empty %}
<meta name="author" content="{{ Page.author }}">
{% endif %}
{# 下記の中身だけはその店舗のdescriptionに変えてください #}
{% set descriptionTag = "{{ BaseInfo.shop_name }}では履きやすくおしゃれな靴を販売しています。" %}
{% if Page.description is not empty %}
{% set descriptionTag = Page.description %}
{% endif %}
{% if Product.description_detail is defined and Product.description_detail is not empty %}
{% set descriptionTag = Product.description_detail|replace({"\n":"", "\r":""}) %}
{% endif %}
{% if Category.name is defined and Category.name is not empty %}
{% set descriptionTag = Category.name~"カテゴリの商品一覧です。"~BaseInfo.shop_name~" オンラインショップ" %}
{% endif %}
{% if titleTag == "全商品 | " %}
{% set descriptionTag = BaseInfo.shop_name~" オンラインショップの商品一覧です。" %}
{% endif %}
{% if descriptionTag %}
{% set descriptionTag = descriptionTag|length > 120 ? descriptionTag|slice(0, 120) ~ '…' : descriptionTag %}
{% spaceless %}
<meta name="description" content="{{ descriptionTag }}">
{% endspaceless %}
{% endif %}
{% if Page.keyword is not empty %}
<meta name="keywords" content="{{ Page.keyword }}">
{% endif %}
{% if Page.meta_robots is not empty %}
<meta name="robots" content="{{ Page.meta_robots }}">
{% endif %}
<meta property="og:title" content="{{ titleTag }}{{ BaseInfo.shop_name }}">
<meta property="og:type" content="{{ OGType }}">
<meta property="og:url" content="{{ app.request.uri }}">
<meta property="og:description" content="{{ descriptionTag }}">
{% set OGImage = url('homepage')~"html/user_data/assets/img/common/og_image.jpg" %}
{# カテゴリイメージがある場合は下記をアンコメント #}
{# {% if category_id is defined and category_id is not empty %}
{% set OGImage = url('homepage')~asset("assets/img/category/img_cate_pc-"~category_id~".jpg", 'user_data') %}
{% endif %} #}
{% if Product is defined and Product is not empty %}
{% set OGImage = url('homepage')~asset(Product.main_list_image|no_image_product, 'save_image') %}
{% endif %}
<meta property="og:image" content="{{ OGImage }}">
{% if Page.meta_tags is not empty %}
{{ include(template_from_string(Page.meta_tags)) }}
{% endif %}