{% spaceless %} {# base_url from page.settings.base_url #} {% set baseurl = page.base_url %} {# Global page vars #} {% set absolutepath = baseurl|addprotocol %} {% set rootpath = baseurl|replace({(page.domain_name): ''}) %} {% set assetspath = page.settings.cdn_files|trim('/')|default(rootpath) %} {% set absolutepath_page = page.permalink|setpath(absolutepath) %} {% set rootpath_page = page.permalink|setpath(rootpath) %} {# Preview image #} {% set preview_image %}{% include 'partials/preview-image.html' %}{% endset %} {% if preview_image is empty %}{% set preview_image = get_default_preview_image() %}{% endif %} {# Preview image full path #} {% set preview_image_full = page.settings.cdn_files|trim('/')|default(absolutepath) ~ preview_image|trim('.') %} {# core paths #} {% set local_public = rootpath ~ '/app/public' %} {% set local_js = local_public ~ '/js/' ~ page.x3_version ~ '/x3.min.js' %} {% set local_css = local_public ~ '/css/' ~ page.x3_version ~ '/x3.skin.' ~ page.style.skin.skin ~ '.css' %} {% if page.settings.cdn_core %} {% set core_js = 'https://cdn.jsdelivr.net/npm/x3.photo.gallery@' ~ page.x3_version ~ '/js/x3.min.js' %} {% set core_css = 'https://cdn.jsdelivr.net/npm/x3.photo.gallery@' ~ page.x3_version ~ '/css/x3.skin.' ~ page.style.skin.skin ~ '.css' %} {% else %} {% set core_js = local_js %} {% set core_css = local_css %} {% endif %} {# VARS #} {% set page_title = '' %} {% set page_description = '' %} {# FILE #} {% if page.template_name == 'file' %} {# Get parent dirname #} {% set dirname = page.permalink|dirname %} {% if dirname == '.' or dirname is empty %}{% set dirname = '/' %}{% endif %} {% set parent = get(dirname) %} {% set parent_images = sortby(parent.images, parent.gallery.sortby, (parent.gallery.sort == 'desc' ? true : false)) %} {# image vars #} {% set this = page.file_path %} {% set image_description = '' %} {% set file_index = 0 %} {% set myimage = '' %} {% set next_image = false %} {% set prev_image = false %} {# find image #} {% for image in parent_images %} {# siblings #} {% if get_next_image %} {% set next_image = image %} {% set get_next_image = false %} {% endif %} {# current image match #} {% if this == image.url %} {# redirect if link #} {% if image.link %} {{ redirect(image.link) }} {# create meta #} {% else %} {% set folder_path = assetspath ~ parent.file_path|trim(".") ~ '/' %} {% set page_title = getDefault(image.title, parent.gallery.image.title, parent.gallery.image.title_include, image.name)|striptags('')|replace({'{file_name}': image.file_name|removeExtension, '{file_name_ext}': image.file_name, '{path}': folder_path, '{image_path}': folder_path ~ image.file_name})|default(image.name) %} {% set image_description = getDefault(image.description, parent.gallery.image.description, parent.gallery.image.description_include, image.name)|striptags('