{% set meta_og_type = 'website' %}
{% set meta_canonical = app.request.uri %}
{% set meta_description = '' %}
{% if app.request.get('_route') == 'product_detail' %}
{% set meta_og_type = "og:product" %}
{% set meta_description = Product.description_detail| default(Product.description_list ) | default(Page.description) %}
{% set meta_canonical = url('product_detail', {'id': Product.id}) %}
{% if Product.search_word %}
{% set meta_og_title = Product.name~' / '~Product.search_word %}
{% else %}
{% set meta_og_title = Product.name %}
{% endif %}
{% set meta_og_img = absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) %}
<meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
<meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
<meta property="product:product_link" content="{{ url('product_detail', {'id': Product.id}) }}"/>
<meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
{% if not Product.stock_find %}
<meta name="robots" content="noindex">
{% endif %}
{% elseif app.request.get('_route') == 'drive_detail' %}
{% set meta_og_type = "og:product" %}
{% set meta_description = Product.description_detail| default(Product.description_list ) | default(Page.description) %}
{% set meta_canonical = url('drive_detail', {'id': Product.id}) %}
{% if Product.search_word %}
{% set meta_og_title = Product.name~' / '~Product.search_word %}
{% else %}
{% set meta_og_title = Product.name %}
{% endif %}
{% set meta_og_img = absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) %}
<meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
<meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
<meta property="product:product_link" content="{{ url('drive_detail', {'id': Product.id}) }}"/>
<meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
{% if not Product.stock_find %}
<meta name="robots" content="noindex">
{% endif %}
{% elseif app.request.get('_route') == 'rental_detail' %}
{% set meta_og_type = "og:product" %}
{% set meta_description = Product.description_detail| default(Product.description_list ) | default(Page.description) %}
{% set meta_canonical = url('rental_detail', {'id': Product.id}) %}
{% if Product.search_word %}
{% set meta_og_title = Product.name~' / '~Product.search_word %}
{% else %}
{% set meta_og_title = Product.name %}
{% endif %}
{% set meta_og_img = absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) %}
<meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
<meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
<meta property="product:product_link" content="{{ url('rental_detail', {'id': Product.id}) }}"/>
<meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
{% if not Product.stock_find %}
<meta name="robots" content="noindex">
{% endif %}
{% elseif app.request.get('_route') == 'ebike_detail' %}
{% set meta_og_type = "og:product" %}
{% set meta_description = Product.description_detail| default(Product.description_list ) | default(Page.description) %}
{% set meta_canonical = url('ebike_detail', {'id': Product.id}) %}
{% set meta_og_title = Product.name %}
{% set meta_og_img = absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) %}
<meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
<meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
<meta property="product:product_link" content="{{ url('ebike_detail', {'id': Product.id}) }}"/>
<meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
{% if not Product.stock_find %}
<meta name="robots" content="noindex">
{% endif %}
{% elseif app.request.get('_route') == 'product_list' %}
{% set meta_canonical = url('product_list', {'category_id': Category.id|default(null)}) %}
{% if pagination|length == 0 %}
<meta name="robots" content="noindex">
{% endif %}
{% elseif app.request.get('_route') == 'plan_detail' %}
{% set meta_description = WpPosts.list_text %}
{% set meta_og_img = WpPosts.main_img %}
{% elseif app.request.get('_route') == 'news' %}
{% elseif app.request.get('_route') == 'signature' or app.request.get('_route') == 'signature_complate' or app.request.get('_route') == 'rentalrule' or app.request.get('_route') == 'rentalrule_complate' or app.request.get('_route') == 'receipt' or app.request.get('_route') == 'receipt_complate' or app.request.get('_route') == 'magarigawa' or app.request.get('_route') == 'magarigawa_complate' %}
{% elseif app.request.get('_route') == 'eventsignature' or app.request.get('_route') == 'eventsignature_complate' %}
{% elseif app.request.get('_route') == 'homepage' %}
{% set meta_og_type = 'website' %}
{% set meta_canonical = url('homepage') %}
{% elseif app.request.get('_route') == 'calc' %}
{% elseif Page is defined and Page.edit_type == 0 and Page.url is defined %}
{% set meta_canonical = url(eccube_config.eccube_user_data_route, {'route': Page.url}) %}
{% endif %}
<meta property="og:title" content="{{ meta_og_title }}" />
<meta property="og:type" content="{{ meta_og_type|default('article') }}"/>
<meta property="og:site_name" content="A Wonderful Day"/>
{% if meta_og_img is defined %}
<meta property="og:image" content="{{ meta_og_img }}">
{% else %}
<meta property="og:image" content="https://giftlife.tokyo/{{ asset('assets/img/awd-share.webp') }}">
{% endif %}
{% set meta_description = meta_description | default(Page.description) %}
{% if meta_description %}
<meta name="description" content="{{ meta_description|striptags|slice(0,120) }}">
<meta property="og:description" content="{{ meta_description|striptags|slice(0,120) }}"/>
{% endif %}
{% if meta_canonical|default() %}
{# canonical url #}
{# Product list #}
{% if Category is defined and Category %}
{% if pagination is defined and pagination.paginationData is defined and pagination.paginationData.pageCount > 1 %}
{# 最初のページ #}
{% if pagination.paginationData.current == 1 %}
<meta property="og:url" content="{{ meta_canonical }}"/>
<link rel="next" href="{{ meta_canonical }}&pageno=2" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': 2 }) }}">
<link rel="canonical" href="{{ meta_canonical }}" />
{# 最後のページ #}
{% elseif pagination.paginationData.last == pagination.paginationData.current %}
<meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}"/>
<link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
<link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}" />
{# 途中のページ #}
{% else %}
<meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}"/>
<link rel="next" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.next }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.next }) }}">
<link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ '%pageno%ページ目'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
<link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}" />
{% endif %}
{% else %}
{# ページング無し #}
<meta property="og:url" content="{{ meta_canonical }}"/>
<link rel="canonical" href="{{ meta_canonical }}" />
{% endif %}
{# Other #}
{% else %}
<meta property="og:url" content="{{ meta_canonical }}"/>
<link rel="canonical" href="{{ meta_canonical }}" />
{% endif %}
{% endif %}