Skip to content
Snippets Groups Projects
Commit 77d27fc8 authored by alexisben's avatar alexisben
Browse files

handle new layout block page layout list

parent b3b354ce
No related branches found
No related tags found
No related merge requests found
......@@ -167,12 +167,16 @@
.block-content
.top
margin-bottom: $spacing1
.description
margin-bottom: $spacing2
ul.title-only
@include grid(2, desktop)
grid-row-gap: $spacing0 !important
grid-column-gap: half($grid-gutter) !important
li
margin-top: 0
a
@include meta
article
gap: half($grid-gutter)
.media
......@@ -184,38 +188,56 @@
.block-title
a
@include stretched-link(before)
.block-content
@include grid
.top
align-items: initial
grid-column: 1 / 8
margin-bottom: 0
display: grid
grid-template-rows: subgrid
grid-row: span 2
.block-title
width: auto
.description
@include body-text
margin-top: 0
// Default behavior (without page description)
.top
.description
p
@include h2
article
.media
width: col(4)
.page-content
width: col(8)
&:not(.with-description)
ul.title-only
@include grid(4, desktop)
@include grid(4, desktop, space(2))
grid-column: 1 / 13
li
margin-top: 0
// If page description
.top + ul
grid-column: 9 / 13
grid-row: 2
display: block
ul:not(.title-only)
@include grid(2, desktop)
li + li
margin-top: $spacing0
article
.media
width: col(2, 6)
.page-content
width: col(4, 6)
margin-top: 0
&.with-description
.block-content
@include grid(12, desktop, $spacing2)
row-gap: half($grid-gutter)
.top
align-items: initial
grid-column: 1 / 8
margin-bottom: 0
display: grid
grid-template-rows: subgrid
grid-row: span 2
.block-title
width: auto
.description
@include body-text
margin-top: 0
// If page description
.top + ul
grid-column: 9 / 13
grid-row: 2
display: block
li + li
margin-top: $spacing0
article
margin-top: $spacing3
&.with-images
.top
grid-column: 1 / 7
.top + ul
grid-column: 7 / 13
&--alternate
.top
......
{{ $length := .length | default 150 }}
{{ $text := replace .text "<" " <" }}
{{ $text := .text }}
{{ if gt .length 0 }}
{{ $text = replace .text "<" " <" }}
{{ $text = chomp (truncate $length "…" (safeHTML (plainify $text))) }}
{{ return $text }}
{{ else }}
{{ return .text }}
{{ end }}
\ No newline at end of file
{{ end }}
{{ return $text }}
\ No newline at end of file
......@@ -4,8 +4,6 @@
{{- $layout := .block.data.layout | default "grid" -}}
{{- with .block.data -}}
{{- $show_main_page := false -}}
{{- $show_main_description := .show_main_description -}}
{{- $show_descriptions := .show_descriptions -}}
{{- $show_images := .show_images -}}
......@@ -19,7 +17,6 @@
{{ end }}
{{- with $page }}
{{- $show_main_page = true -}}
{{- $page_link = $page.Permalink }}
{{ if eq $title "" }}
{{ $title = .Title }}
......@@ -39,13 +36,18 @@
{{ end }}
{{ end -}}
{{ if $main_description }}
{{/* SHOULD BE FIXED WITH ORTHOTYPO */}}
{{ $main_description = printf "<p>%s</p>" $main_description }}
{{ $block_class = printf "%s %s" $block_class "with-description" }}
{{ end }}
{{ if $show_images }}
{{ $block_class = printf "%s %s" $block_class "with-images" }}
{{ end }}
<div class="{{ $block_class }} {{ $page_class }}">
<div class="container">
<div class="block-content">
{{ if $main_description }}
{{ $main_description = printf "<p>%s</p>" $main_description }}
{{ end }}
{{ partial "blocks/top.html" (dict
"title" $title
"link" $page_link
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment