mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
New features for version 1.0.5 (#35)
This commit is contained in:
commit
1fd27abbc2
16 changed files with 237 additions and 81 deletions
|
@ -70,21 +70,8 @@ form:
|
|||
asc: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_ORDER_DIR_ASC
|
||||
desc: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_ORDER_DIR_DESC
|
||||
|
||||
header.show_breadcrumbs:
|
||||
header.content.pagination:
|
||||
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
|
||||
highlight: 1
|
||||
default: 1
|
||||
|
@ -96,7 +83,6 @@ form:
|
|||
|
||||
header.content.url_taxonomy_filters:
|
||||
type: toggle
|
||||
toggleable: true
|
||||
label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS
|
||||
highlight: 1
|
||||
default: 1
|
||||
|
@ -128,4 +114,8 @@ form:
|
|||
telegram: Telegram
|
||||
use: keys
|
||||
|
||||
import@:
|
||||
type: partials/blog-bits
|
||||
context: blueprints://pages
|
||||
|
||||
|
||||
|
|
|
@ -22,14 +22,47 @@ form:
|
|||
header.subtitle:
|
||||
type: text
|
||||
style: vertical
|
||||
size: long
|
||||
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:
|
||||
ordering@: header.subtitle
|
||||
style: vertical
|
||||
size: medium
|
||||
type: pagemediaselect
|
||||
label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE
|
||||
label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE.LABEL
|
||||
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:
|
||||
fields:
|
||||
publishing:
|
||||
|
|
|
@ -12,8 +12,16 @@ form:
|
|||
fields:
|
||||
header.content:
|
||||
fields:
|
||||
image_section:
|
||||
unset@: true
|
||||
header.primaryImage:
|
||||
unset@: true
|
||||
header.show_pageimage:
|
||||
unset@: true
|
||||
header.image_width:
|
||||
unset@: true
|
||||
header.image_height:
|
||||
unset@: true
|
||||
banner:
|
||||
type: tab
|
||||
title: FUTURE.ADMIN.MODULAR.BANNER.BANNER_TAB
|
||||
|
|
39
blueprints/partials/blog-bits.yaml
Normal file
39
blueprints/partials/blog-bits.yaml
Normal 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
|
|
@ -55,7 +55,14 @@ en:
|
|||
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'
|
||||
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
|
||||
BODY_CLASSES: 'You can create new CSS classes for the body and add them here'
|
||||
MODULAR:
|
||||
|
@ -81,6 +88,9 @@ en:
|
|||
|
||||
BLOG:
|
||||
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_ITEMS: Items
|
||||
BLOG_CONTENT_ITEMS_LIMIT: Max Item Count
|
||||
|
@ -93,7 +103,8 @@ en:
|
|||
BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Ascending
|
||||
BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Descending
|
||||
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_SHAREICONS_TITLE: 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_TOP: In vollem Fensterkörper öffnen
|
||||
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
|
||||
BODY_CLASSES: 'Sie können neue CSS-Klassen für den body erstellen und hier hinzufügen.'
|
||||
MODULAR:
|
||||
|
@ -314,6 +332,9 @@ de:
|
|||
|
||||
BLOG:
|
||||
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_ITEMS: Artikel
|
||||
BLOG_CONTENT_ITEMS_LIMIT: Maximale Artikel-Anzahl
|
||||
|
@ -326,7 +347,8 @@ de:
|
|||
BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Aufsteigend
|
||||
BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Absteigend
|
||||
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
|
||||
ITEM:
|
||||
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_TOP: 'Abrir en todo el cuerpo de la ventana'
|
||||
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
|
||||
BODY_CLASSES: 'Puede crear nuevas clases CSS para el body y añadirlas aquí.'
|
||||
MODULAR:
|
||||
|
@ -544,6 +573,9 @@ es:
|
|||
|
||||
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_ITEMS: 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_DESC: Descendente
|
||||
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_SHAREICONS_TITLE: Iconos de Redes Sociales
|
||||
BLOG_CONTENT_SHAREICONS: Mostrar iconos de Redes Sociales
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
{% set feed_url = base_url %}
|
||||
{% set show_breadcrumbs = header_var('show_breadcrumbs')|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 title = page.title|raw %}
|
||||
|
||||
|
@ -68,5 +67,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% if show_sidebar == true %}
|
||||
{% include 'partials/sidebar_left.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
{% 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 subtitle = page.header.subtitle|raw %}
|
||||
|
||||
|
@ -13,24 +18,21 @@
|
|||
<article class="post">
|
||||
<header>
|
||||
<div class="title">
|
||||
<h2>
|
||||
{{ title }}
|
||||
</h2>
|
||||
<h2>{{ title }}</h2>
|
||||
{% if subtitle %}
|
||||
<p>
|
||||
{{ subtitle }}
|
||||
</p>
|
||||
<p>{{ subtitle }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% if image %}
|
||||
{% if show_image and image %}
|
||||
<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>
|
||||
{% endif %}
|
||||
|
||||
{{ page.content|raw }}
|
||||
|
||||
</article>
|
||||
|
||||
{% if show_sidebar == false %}
|
||||
|
@ -41,5 +43,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% if show_sidebar == true %}
|
||||
{% include 'partials/sidebar_left.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -34,5 +34,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% if show_sidebar == true %}
|
||||
{% include 'partials/sidebar_left.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
{% 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 subtitle = page.header.subtitle|raw %}
|
||||
|
||||
|
@ -26,9 +32,9 @@
|
|||
</div>
|
||||
</header>
|
||||
|
||||
{% if image %}
|
||||
{% if show_image and image %}
|
||||
<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>
|
||||
{% endif %}
|
||||
|
||||
|
@ -40,6 +46,10 @@
|
|||
</article>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
{% if show_sidebar == true %}
|
||||
{% include 'partials/sidebar_left.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -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 subtitle = page.header.subtitle|raw %}
|
||||
|
||||
|
|
|
@ -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 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' %}
|
||||
|
||||
<section id="features">
|
||||
|
@ -11,8 +21,8 @@
|
|||
{% endif %}
|
||||
</header>
|
||||
|
||||
{% if image %}
|
||||
{{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title, 'image featured')|raw }}
|
||||
{% if show_image and image %}
|
||||
{{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title, 'image featured')|raw }}
|
||||
{% endif %}
|
||||
|
||||
{{ page.content|raw }}
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
{% 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 %}
|
||||
|
||||
{# Define if sidebar is shown in the page #}
|
||||
{% set show_sidebar = header_var('show_sidebar')|defined(false) %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
|
||||
<head>
|
||||
|
@ -54,9 +57,9 @@
|
|||
<div id="main">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
{% if show_sidebar == true %}
|
||||
|
||||
{% block sidebar %}{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -10,10 +10,19 @@
|
|||
{% set author = page.taxonomy.author[0] %}
|
||||
{% endif %}
|
||||
|
||||
{% set title = page.title|raw %}
|
||||
{# Set avatar image and primary image #}
|
||||
{% 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 %}
|
||||
|
||||
{# 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>
|
||||
<div class="title">
|
||||
{% if page.header.link %}
|
||||
|
@ -28,8 +37,8 @@
|
|||
<a href="{{ page.url }}" aria-label="{{ title }}">{{ title }}</a>
|
||||
</h2>
|
||||
{% endif %}
|
||||
{% if page.header.subtitle %}
|
||||
<p itemprop="alternativeHeadline">{{ page.header.subtitle|raw }}</p>
|
||||
{% if subtitle %}
|
||||
<p itemprop="alternativeHeadline">{{ subtitle|raw }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="meta">
|
||||
|
@ -49,9 +58,9 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
{% if image %}
|
||||
{% if show_image and image %}
|
||||
<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>
|
||||
{% endif %}
|
||||
<div itemprop="articleBody">
|
||||
|
|
|
@ -20,6 +20,11 @@
|
|||
{% 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 %}
|
||||
|
||||
{# 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">
|
||||
<header>
|
||||
<h3>
|
||||
|
@ -36,9 +41,9 @@
|
|||
<a href="{{ p.url }}" class="author" title="{{ author }}"><img src="{{ avatar }}" alt="{{ author }}"/></a>
|
||||
{% endif %}
|
||||
</header>
|
||||
{% if image %}
|
||||
{% if show_image and image %}
|
||||
<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>
|
||||
{% endif %}
|
||||
</article>
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
{% 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 subtitle = page.header.subtitle|raw %}
|
||||
{% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %}
|
||||
|
@ -12,6 +17,7 @@
|
|||
button.gclose.gbtn, button.gnext.gbtn, button.gprev.gbtn {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
{% endset %}
|
||||
{% do assets.addInlineCss(styling) %}
|
||||
{% endblock %}
|
||||
|
@ -28,19 +34,15 @@
|
|||
<article class="post">
|
||||
<header>
|
||||
<div class="title">
|
||||
<h2>
|
||||
{{ title }}
|
||||
</h2>
|
||||
<h2>{{ title }}</h2>
|
||||
{% if subtitle %}
|
||||
<p>
|
||||
{{ subtitle }}
|
||||
</p>
|
||||
<p>{{ subtitle }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
{% if image %}
|
||||
{% if show_image and image %}
|
||||
<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>
|
||||
{% endif %}
|
||||
|
||||
|
@ -76,7 +78,9 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% if show_sidebar == true %}
|
||||
{% include 'partials/sidebar_left.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set show_sidebar = theme_var('sidebar')|defined(false) %}
|
||||
{% set sidebar = theme_var('sidebar')|defined(false) %}
|
||||
|
||||
{% block menu %}
|
||||
{% include 'partials/sidebar_right.html.twig' %}
|
||||
|
@ -35,7 +35,7 @@
|
|||
{% endfor %}
|
||||
</article>
|
||||
|
||||
{% if show_sidebar == false %}
|
||||
{% if sidebar == false %}
|
||||
<section id="footer" class="align-center">
|
||||
{% include 'partials/footer.html.twig' %}
|
||||
</section>
|
||||
|
@ -43,5 +43,8 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% if sidebar == true %}
|
||||
{% include 'partials/sidebar_left.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue