New features for version 1.0.5 (#35)

This commit is contained in:
pmoreno.rodriguez 2023-03-09 19:13:34 +01:00 committed by GitHub
commit 1fd27abbc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 237 additions and 81 deletions

View file

@ -69,22 +69,9 @@ form:
options: options:
asc: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_ORDER_DIR_ASC asc: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_ORDER_DIR_ASC
desc: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_ORDER_DIR_DESC desc: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_ORDER_DIR_DESC
header.show_breadcrumbs: header.content.pagination:
type: toggle type: toggle
toggleable: true
label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_BREADCRUMBS
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
header.show_pagination:
type: toggle
toggleable: true
label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_PAGINATION label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_PAGINATION
highlight: 1 highlight: 1
default: 1 default: 1
@ -93,10 +80,9 @@ form:
0: PLUGIN_ADMIN.DISABLED 0: PLUGIN_ADMIN.DISABLED
validate: validate:
type: bool type: bool
header.content.url_taxonomy_filters: header.content.url_taxonomy_filters:
type: toggle type: toggle
toggleable: true
label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS
highlight: 1 highlight: 1
default: 1 default: 1
@ -127,5 +113,9 @@ form:
whatsapp: Whatsapp whatsapp: Whatsapp
telegram: Telegram telegram: Telegram
use: keys use: keys
import@:
type: partials/blog-bits
context: blueprints://pages

View file

@ -22,14 +22,47 @@ form:
header.subtitle: header.subtitle:
type: text type: text
style: vertical style: vertical
size: long
label: FUTURE.ADMIN.ITEM.ITEM_SUBTITLE label: FUTURE.ADMIN.ITEM.ITEM_SUBTITLE
image_section:
type: section
underline: true
title: FUTURE.ADMIN.DEFAULT.IMAGE_OPTIONS
header.show_pageimage:
type: toggle
style: vertical
label: FUTURE.ADMIN.DEFAULT.SHOW_PAGEIMAGE
help: FUTURE.ADMIN.DEFAULT.SHOW_PAGEIMAGE_HELP
default: 1
highlight: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
header.primaryImage: header.primaryImage:
ordering@: header.subtitle ordering@: header.subtitle
style: vertical style: vertical
size: medium size: medium
type: pagemediaselect type: pagemediaselect
label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE.LABEL
preview_images: true preview_images: true
header.image_width:
type: number
style: vertical
label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE.WIDTH
size: small
default: 1038
header.image_height:
type: number
style: vertical
label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE.HEIGHT
size: small
default: 437
content_section:
type: section
underline: true
title: FUTURE.ADMIN.DEFAULT.CONTENT
options: options:
fields: fields:
publishing: publishing:

View file

@ -12,8 +12,16 @@ form:
fields: fields:
header.content: header.content:
fields: fields:
image_section:
unset@: true
header.primaryImage: header.primaryImage:
unset@: true unset@: true
header.show_pageimage:
unset@: true
header.image_width:
unset@: true
header.image_height:
unset@: true
banner: banner:
type: tab type: tab
title: FUTURE.ADMIN.MODULAR.BANNER.BANNER_TAB title: FUTURE.ADMIN.MODULAR.BANNER.BANNER_TAB

View file

@ -0,0 +1,39 @@
form:
fields:
blog_config:
type: spacer
title: FUTURE.ADMIN.BLOG.BLOG_CONFIGURATION
header.blog_url:
type: text
toggleable: true
label: FUTURE.ADMIN.BLOG.BLOG_ROUTE
help: FUTURE.ADMIN.BLOG.BLOG_ROUTE_HELP
default: '/blog'
placeholder: '/blog'
size: medium
header.show_breadcrumbs:
type: toggle
toggleable: true
label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_BREADCRUMBS
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
header.show_pagination:
type: toggle
toggleable: true
label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_SHOWPAGINATION
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool

View file

@ -55,7 +55,14 @@ en:
CUSTOM_MENU_ITEM_TARGET_SELF: 'Open in the same frame as clicked' CUSTOM_MENU_ITEM_TARGET_SELF: 'Open in the same frame as clicked'
CUSTOM_MENU_ITEM_TARGET_TOP: 'Open in the full body of the window' CUSTOM_MENU_ITEM_TARGET_TOP: 'Open in the full body of the window'
DEFAULT: DEFAULT:
PRIMARY_IMAGE: Primary image CONTENT: Content
IMAGE_OPTIONS: Image options
PRIMARY_IMAGE:
LABEL: Primary image
WIDTH: Width
HEIGHT: Height
SHOW_PAGEIMAGE: Show Image
SHOW_PAGEIMAGE_HELP: Enable primary image if it is defined or the first image of the media page.
SHOW_SIDEBAR: Show Sidebar SHOW_SIDEBAR: Show Sidebar
BODY_CLASSES: 'You can create new CSS classes for the body and add them here' BODY_CLASSES: 'You can create new CSS classes for the body and add them here'
MODULAR: MODULAR:
@ -81,6 +88,9 @@ en:
BLOG: BLOG:
BLOG_TAB: Blog Config BLOG_TAB: Blog Config
BLOG_CONFIGURATION: Configuration
BLOG_ROUTE: Blog Route
BLOG_ROUTE_HELP: The route to the main blog page that contains the "Show ..." configuration
BLOG_CONTENT_TITLE: Content Definition BLOG_CONTENT_TITLE: Content Definition
BLOG_CONTENT_ITEMS: Items BLOG_CONTENT_ITEMS: Items
BLOG_CONTENT_ITEMS_LIMIT: Max Item Count BLOG_CONTENT_ITEMS_LIMIT: Max Item Count
@ -93,7 +103,8 @@ en:
BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Ascending BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Ascending
BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Descending BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Descending
BLOG_CONTENT_ITEMS_BREADCRUMBS: Show Breadcrumbs BLOG_CONTENT_ITEMS_BREADCRUMBS: Show Breadcrumbs
BLOG_CONTENT_ITEMS_PAGINATION: Show Pagination BLOG_CONTENT_ITEMS_SHOWPAGINATION: Show Pagination
BLOG_CONTENT_ITEMS_PAGINATION: Pagination
BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: URL Taxonomy Filters BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: URL Taxonomy Filters
BLOG_CONTENT_SHAREICONS_TITLE: Social Media Icons BLOG_CONTENT_SHAREICONS_TITLE: Social Media Icons
BLOG_CONTENT_SHAREICONS: Select Social Media Icons BLOG_CONTENT_SHAREICONS: Select Social Media Icons
@ -288,7 +299,14 @@ de:
CUSTOM_MENU_ITEM_TARGET_SELF: In selbem Frame öffnen CUSTOM_MENU_ITEM_TARGET_SELF: In selbem Frame öffnen
CUSTOM_MENU_ITEM_TARGET_TOP: In vollem Fensterkörper öffnen CUSTOM_MENU_ITEM_TARGET_TOP: In vollem Fensterkörper öffnen
DEFAULT: DEFAULT:
PRIMARY_IMAGE: Hauptbild CONTENT: Inhalt
IMAGE_OPTIONS: Bildoptionen
PRIMARY_IMAGE:
LABEL: Hauptbild
WIDTH: Breite
HEIGHT: Höhe
SHOW_PAGEIMAGE: Show Image
SHOW_PAGEIMAGE_HELP: Enable primary image if it is defined or the first image of the media page.
SHOW_SIDEBAR: Seitenleiste anzeigen SHOW_SIDEBAR: Seitenleiste anzeigen
BODY_CLASSES: 'Sie können neue CSS-Klassen für den body erstellen und hier hinzufügen.' BODY_CLASSES: 'Sie können neue CSS-Klassen für den body erstellen und hier hinzufügen.'
MODULAR: MODULAR:
@ -314,6 +332,9 @@ de:
BLOG: BLOG:
BLOG_TAB: Blog-Einstellungen BLOG_TAB: Blog-Einstellungen
BLOG_CONFIGURATION: Konfiguration
BLOG_ROUTE: Blogroute
BLOG_ROUTE_HELP: Die Route zur Hauptseite des Blogs, die die Konfiguration "Show ..." enthält
BLOG_CONTENT_TITLE: Inhaltseinstellungen BLOG_CONTENT_TITLE: Inhaltseinstellungen
BLOG_CONTENT_ITEMS: Artikel BLOG_CONTENT_ITEMS: Artikel
BLOG_CONTENT_ITEMS_LIMIT: Maximale Artikel-Anzahl BLOG_CONTENT_ITEMS_LIMIT: Maximale Artikel-Anzahl
@ -326,7 +347,8 @@ de:
BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Aufsteigend BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Aufsteigend
BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Absteigend BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Absteigend
BLOG_CONTENT_ITEMS_BREADCRUMBS: Brotkrümelnavigation anzeigen BLOG_CONTENT_ITEMS_BREADCRUMBS: Brotkrümelnavigation anzeigen
BLOG_CONTENT_ITEMS_PAGINATION: Seitennummerierung BLOG_CONTENT_ITEMS_SHOWPAGINATION: Paginierung anzeigen
BLOG_CONTENT_ITEMS_PAGINATION: Paginierung
BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: Taxonomie filtern nach URL BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: Taxonomie filtern nach URL
ITEM: ITEM:
ITEM_TAB: Blog-Artikel ITEM_TAB: Blog-Artikel
@ -518,7 +540,14 @@ es:
CUSTOM_MENU_ITEM_TARGET_SELF: 'Abrir en el mismo marco en el que se hizo clic' CUSTOM_MENU_ITEM_TARGET_SELF: 'Abrir en el mismo marco en el que se hizo clic'
CUSTOM_MENU_ITEM_TARGET_TOP: 'Abrir en todo el cuerpo de la ventana' CUSTOM_MENU_ITEM_TARGET_TOP: 'Abrir en todo el cuerpo de la ventana'
DEFAULT: DEFAULT:
PRIMARY_IMAGE: Imagen principal CONTENT: Contenido
IMAGE_OPTIONS: Opciones de imagen
PRIMARY_IMAGE:
LABEL: Imagen principal
WIDTH: Ancho
HEIGHT: Alto
SHOW_PAGEIMAGE: Mostrar imagen
SHOW_PAGEIMAGE_HELP: Habilitar la imagen principal si está definida o la primera de las imágenes de la página.
SHOW_SIDEBAR: Mostrar Barra Lateral SHOW_SIDEBAR: Mostrar Barra Lateral
BODY_CLASSES: 'Puede crear nuevas clases CSS para el body y añadirlas aquí.' BODY_CLASSES: 'Puede crear nuevas clases CSS para el body y añadirlas aquí.'
MODULAR: MODULAR:
@ -544,6 +573,9 @@ es:
BLOG: BLOG:
BLOG_TAB: Configuración del Blog BLOG_TAB: Configuración del Blog
BLOG_CONFIGURATION: Configuración
BLOG_ROUTE: Ruta del Blog
BLOG_ROUTE_HELP: La ruta a la página principal del blog que contiene la configuración "Mostrar..."
BLOG_CONTENT_TITLE: Definición de Contenido BLOG_CONTENT_TITLE: Definición de Contenido
BLOG_CONTENT_ITEMS: Artículos BLOG_CONTENT_ITEMS: Artículos
BLOG_CONTENT_ITEMS_LIMIT: Límite máximo de artículos BLOG_CONTENT_ITEMS_LIMIT: Límite máximo de artículos
@ -556,7 +588,8 @@ es:
BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Ascendente BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Ascendente
BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Descendente BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Descendente
BLOG_CONTENT_ITEMS_BREADCRUMBS: Mostrar Migas de Pan BLOG_CONTENT_ITEMS_BREADCRUMBS: Mostrar Migas de Pan
BLOG_CONTENT_ITEMS_PAGINATION: Mostrar Paginación BLOG_CONTENT_ITEMS_SHOWPAGINATION: Mostrar paginación
BLOG_CONTENT_ITEMS_PAGINATION: Paginación
BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: Filtros de taxonomía por URL BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: Filtros de taxonomía por URL
BLOG_CONTENT_SHAREICONS_TITLE: Iconos de Redes Sociales BLOG_CONTENT_SHAREICONS_TITLE: Iconos de Redes Sociales
BLOG_CONTENT_SHAREICONS: Mostrar iconos de Redes Sociales BLOG_CONTENT_SHAREICONS: Mostrar iconos de Redes Sociales

View file

@ -5,7 +5,6 @@
{% set feed_url = base_url %} {% set feed_url = base_url %}
{% set show_breadcrumbs = header_var('show_breadcrumbs')|defined(true) %} {% set show_breadcrumbs = header_var('show_breadcrumbs')|defined(true) %}
{% set show_pagination = header_var('show_pagination')|defined(true) %} {% set show_pagination = header_var('show_pagination')|defined(true) %}
{% set show_sidebar = header_var('show_sidebar')|defined(false) %}
{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %} {% set image = page.media[page.header.primaryImage] ?: page.media.images|first %}
{% set title = page.title|raw %} {% set title = page.title|raw %}
@ -68,5 +67,7 @@
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{% if show_sidebar == true %}
{% include 'partials/sidebar_left.html.twig' %} {% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %} {% endblock %}

View file

@ -1,7 +1,12 @@
{% extends 'partials/base.html.twig' %} {% extends 'partials/base.html.twig' %}
{% set show_sidebar = header_var('show_sidebar')|defined(false) %}
{% set image = page.media[page.header.primaryImage] ? : page.media.images|first {# Define if the primary image and the attributes of width and height are shown #}
%} {% set show_image = header_var('show_pageimage')|defined(true) %}
{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v, k) => k != page.header.primaryImage and (v.type == 'image' or v.type == 'vector'))|first %}
{% set img_width = header_var('image_width')|default(1038) %}
{% set img_height = header_var('image_height')|default(437) %}
{# Set title and subtitle #}
{% set title = page.title|raw %} {% set title = page.title|raw %}
{% set subtitle = page.header.subtitle|raw %} {% set subtitle = page.header.subtitle|raw %}
@ -13,24 +18,21 @@
<article class="post"> <article class="post">
<header> <header>
<div class="title"> <div class="title">
<h2> <h2>{{ title }}</h2>
{{ title }}
</h2>
{% if subtitle %} {% if subtitle %}
<p> <p>{{ subtitle }}</p>
{{ subtitle }}
</p>
{% endif %} {% endif %}
</div> </div>
</header> </header>
{% if image %} {% if show_image and image %}
<span class="image featured"> <span class="image featured">
{{ image.cropZoom(1038, 437).loading('lazy').attribute('decoding','async').html(title, title)|raw }} {{ image.cropZoom(img_width, img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
</span> </span>
{% endif %} {% endif %}
{{ page.content|raw }} {{ page.content|raw }}
</article> </article>
{% if show_sidebar == false %} {% if show_sidebar == false %}
@ -41,5 +43,7 @@
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{% if show_sidebar == true %}
{% include 'partials/sidebar_left.html.twig' %} {% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %} {% endblock %}

View file

@ -34,5 +34,7 @@
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{% if show_sidebar == true %}
{% include 'partials/sidebar_left.html.twig' %} {% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %} {% endblock %}

View file

@ -1,6 +1,12 @@
{% extends 'partials/base.html.twig' %} {% extends 'partials/base.html.twig' %}
{% set show_sidebar = header_var('show_sidebar')|defined(false) %}
{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %} {# Define if the primary image and the attributes of width and height are shown #}
{% set show_image = header_var('show_pageimage')|defined(true) %}
{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v) => (v.type == 'image' or v.type == 'vector'))|first %}
{% set img_width = header_var('image_width')|default(1038) %}
{% set img_height = header_var('image_height')|default(437) %}
{# Set title and subtitle #}
{% set title = page.title|raw %} {% set title = page.title|raw %}
{% set subtitle = page.header.subtitle|raw %} {% set subtitle = page.header.subtitle|raw %}
@ -26,9 +32,9 @@
</div> </div>
</header> </header>
{% if image %} {% if show_image and image %}
<span class="image featured"> <span class="image featured">
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }} {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
</span> </span>
{% endif %} {% endif %}
@ -40,6 +46,10 @@
</article> </article>
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{% if show_sidebar == true %}
{% include 'partials/sidebar_left.html.twig' %} {% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %} {% endblock %}

View file

@ -1,4 +1,6 @@
{% set image = page.media[page.header.image] ?: page.media.images|first %} {# Set banner image #}
{% set image = page.media[page.header.image] ?: page.media.all|filter((v) => (v.type == 'image' or v.type == 'vector'))|first %}
{% set title = page.title|raw %} {% set title = page.title|raw %}
{% set subtitle = page.header.subtitle|raw %} {% set subtitle = page.header.subtitle|raw %}

View file

@ -1,6 +1,16 @@
{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %} {# Define if sidebar is shown in the page #}
{% set show_image = header_var('show_pageimage')|defined(true) %}
{# Define if the primary image and the attributes of width and height are shown #}
{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v) => (v.type == 'image' or v.type == 'vector'))|first %}
{% set img_width = header_var('image_width')|default(1038) %}
{% set img_height = header_var('image_height')|default(437) %}
{# Set title and subtitle #}
{% set title = page.title|raw %} {% set title = page.title|raw %}
{% set subtitle = page.header.subtitle|raw %} {% set subtitle = page.header.subtitle|raw %}
{# Set columns for features page #}
{% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %} {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %}
<section id="features"> <section id="features">
@ -11,8 +21,8 @@
{% endif %} {% endif %}
</header> </header>
{% if image %} {% if show_image and image %}
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title, 'image featured')|raw }} {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title, 'image featured')|raw }}
{% endif %} {% endif %}
{{ page.content|raw }} {{ page.content|raw }}

View file

@ -3,6 +3,9 @@
{% set favicon = theme_config.favicon ? theme_config.favicon|first : { type:'image/png', path: url('theme://images/favicon.png') } %} {% set favicon = theme_config.favicon ? theme_config.favicon|first : { type:'image/png', path: url('theme://images/favicon.png') } %}
{% set new_base_url = base_url_absolute ~ theme_config.blog_page %} {% set new_base_url = base_url_absolute ~ theme_config.blog_page %}
{# Define if sidebar is shown in the page #}
{% set show_sidebar = header_var('show_sidebar')|defined(false) %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}"> <html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
<head> <head>
@ -54,9 +57,9 @@
<div id="main"> <div id="main">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
{% if show_sidebar == true %}
{% block sidebar %}{% endblock %} {% block sidebar %}{% endblock %}
{% endif %}
{% endblock %} {% endblock %}
{% endblock %} {% endblock %}

View file

@ -10,9 +10,18 @@
{% set author = page.taxonomy.author[0] %} {% set author = page.taxonomy.author[0] %}
{% endif %} {% endif %}
{% set title = page.title|raw %} {# Set avatar image and primary image #}
{% set avatar = page.media[page.header.avatarImage].url|e %} {% set avatar = page.media[page.header.avatarImage].url|e %}
{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v, k) => k != page.header.avatarImage and (v.type == 'image' or v.type == 'vector'))|first %} {% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v, k) => k != page.header.avatarImage and (v.type == 'image' or v.type == 'vector'))|first %}
{# Define if the primary image and the attributes of width and height are shown #}
{% set show_image = header_var('show_pageimage')|defined(true) %}
{% set img_width = header_var('image_width')|default(1038) %}
{% set img_height = header_var('image_height')|default(437) %}
{# Set title and subtitle #}
{% set title = page.title|raw %}
{% set subtitle = page.header.subtitle|raw %}
<header> <header>
<div class="title"> <div class="title">
@ -28,8 +37,8 @@
<a href="{{ page.url }}" aria-label="{{ title }}">{{ title }}</a> <a href="{{ page.url }}" aria-label="{{ title }}">{{ title }}</a>
</h2> </h2>
{% endif %} {% endif %}
{% if page.header.subtitle %} {% if subtitle %}
<p itemprop="alternativeHeadline">{{ page.header.subtitle|raw }}</p> <p itemprop="alternativeHeadline">{{ subtitle|raw }}</p>
{% endif %} {% endif %}
</div> </div>
<div class="meta"> <div class="meta">
@ -49,9 +58,9 @@
{% endif %} {% endif %}
</div> </div>
</header> </header>
{% if image %} {% if show_image and image %}
<a class="image featured" href="{{ page.url }}" title="{{ title|raw }}" rel="nofollow"> <a class="image featured" href="{{ page.url }}" title="{{ title|raw }}" rel="nofollow">
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }} {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
</a> </a>
{% endif %} {% endif %}
<div itemprop="articleBody"> <div itemprop="articleBody">

View file

@ -19,6 +19,11 @@
{% set title = p.title|raw %} {% set title = p.title|raw %}
{% set avatar = p.media[p.header.avatarImage].url|e %} {% set avatar = p.media[p.header.avatarImage].url|e %}
{% set image = p.media[p.header.primaryImage] ?: p.media.all|filter((v, k) => k != p.header.avatarImage and (v.type == 'image' or v.type == 'vector'))|first %} {% set image = p.media[p.header.primaryImage] ?: p.media.all|filter((v, k) => k != p.header.avatarImage and (v.type == 'image' or v.type == 'vector'))|first %}
{# Define if the primary image and the attributes of width and height are shown #}
{% set show_image = p.header.show_pageimage|defined(true) %}
{% set img_width = p.header.image_width|default(1038) %}
{% set img_height = p.header.image_height|default(437) %}
<article class="mini-post"> <article class="mini-post">
<header> <header>
@ -36,9 +41,9 @@
<a href="{{ p.url }}" class="author" title="{{ author }}"><img src="{{ avatar }}" alt="{{ author }}"/></a> <a href="{{ p.url }}" class="author" title="{{ author }}"><img src="{{ avatar }}" alt="{{ author }}"/></a>
{% endif %} {% endif %}
</header> </header>
{% if image %} {% if show_image and image %}
<a href="{{ p.url }}" class="image" title="{{ title|raw }}" rel="nofollow"> <a href="{{ p.url }}" class="image" title="{{ title|raw }}" rel="nofollow">
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title,title)|raw}} {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title,title)|raw}}
</a> </a>
{% endif %} {% endif %}
</article> </article>

View file

@ -1,6 +1,11 @@
{% extends 'partials/base.html.twig' %} {% extends 'partials/base.html.twig' %}
{% set show_sidebar = header_var('show_sidebar')|defined(false) %}
{% set image = page.media[page.header.primaryImage] %} {# Define if the primary image and the attributes of width and height are shown #}
{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v) => (v.type == 'image' or v.type == 'vector'))|first %}
{% set img_width = header_var('image_width')|default(1038) %}
{% set img_height = header_var('image_height')|default(437) %}
{# Set title and subtitle #}
{% set title = page.title|raw %} {% set title = page.title|raw %}
{% set subtitle = page.header.subtitle|raw %} {% set subtitle = page.header.subtitle|raw %}
{% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %} {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %}
@ -9,9 +14,10 @@
{{ parent() }} {{ parent() }}
{% do assets.addCss('theme://assets/css/glightbox.min.css') %} {% do assets.addCss('theme://assets/css/glightbox.min.css') %}
{% set styling %} {% set styling %}
button.gclose.gbtn, button.gnext.gbtn, button.gprev.gbtn { button.gclose.gbtn, button.gnext.gbtn, button.gprev.gbtn {
box-shadow: none !important; box-shadow: none !important;
} }
{% endset %} {% endset %}
{% do assets.addInlineCss(styling) %} {% do assets.addInlineCss(styling) %}
{% endblock %} {% endblock %}
@ -28,19 +34,15 @@
<article class="post"> <article class="post">
<header> <header>
<div class="title"> <div class="title">
<h2> <h2>{{ title }}</h2>
{{ title }}
</h2>
{% if subtitle %} {% if subtitle %}
<p> <p>{{ subtitle }}</p>
{{ subtitle }}
</p>
{% endif %} {% endif %}
</div> </div>
</header> </header>
{% if image %} {% if show_image and image %}
<span class="image featured"> <span class="image featured">
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }} {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }}
</span> </span>
{% endif %} {% endif %}
@ -50,19 +52,19 @@
{% block portfolio %} {% block portfolio %}
<section> <section>
<div class="row aln-center"> <div class="row aln-center">
{% for item in gallery %} {% for item in gallery %}
{% set item_image = page.media[item.image] %} {% set item_image = page.media[item.image] %}
{% set item_title = item.title %} {% set item_title = item.title %}
{% set item_desc = item.description %} {% set item_desc = item.description %}
{% set thumbnail = item_image.cropZoom(thumb_w, thumb_h).loading('lazy').attribute('decoding','async').attribute('itemprop','http://schema.org/image').html(item_title,item_title) %} {% set thumbnail = item_image.cropZoom(thumb_w, thumb_h).loading('lazy').attribute('decoding','async').attribute('itemprop','http://schema.org/image').html(item_title,item_title) %}
<div class="{{columns}} portfolio_item"> <div class="{{columns}} portfolio_item">
<a href="{{item_image.url}}" class="glightbox"data-height="{{page.header.height}}" data-width="{{page.header.width}}" data-title="{{item_title}}" data-description="{{item_desc|raw}}" data-desc-position="{{item.descPosition}}" data-zoomable="{{page.header.zoomable}}" data-draggable="{{page.header.draggable}}" data-type="image"> <a href="{{item_image.url}}" class="glightbox" data-height="{{page.header.height}}" data-width="{{page.header.width}}" data-title="{{item_title}}" data-description="{{item_desc|raw}}" data-desc-position="{{item.descPosition}}" data-zoomable="{{page.header.zoomable}}" data-draggable="{{page.header.draggable}}" data-type="image">
<span class="image fit"> <span class="image fit">
{{ thumbnail }} {{ thumbnail }}
</span> </span>
</a> </a>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</section> </section>
{% endblock %} {% endblock %}
@ -76,7 +78,9 @@
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{% if show_sidebar == true %}
{% include 'partials/sidebar_left.html.twig' %} {% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}

View file

@ -1,6 +1,6 @@
{% extends 'partials/base.html.twig' %} {% extends 'partials/base.html.twig' %}
{% set show_sidebar = theme_var('sidebar')|defined(false) %} {% set sidebar = theme_var('sidebar')|defined(false) %}
{% block menu %} {% block menu %}
{% include 'partials/sidebar_right.html.twig' %} {% include 'partials/sidebar_right.html.twig' %}
@ -35,7 +35,7 @@
{% endfor %} {% endfor %}
</article> </article>
{% if show_sidebar == false %} {% if sidebar == false %}
<section id="footer" class="align-center"> <section id="footer" class="align-center">
{% include 'partials/footer.html.twig' %} {% include 'partials/footer.html.twig' %}
</section> </section>
@ -43,5 +43,8 @@
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{% if sidebar == true %}
{% include 'partials/sidebar_left.html.twig' %} {% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %} {% endblock %}