Skip to content
Snippets Groups Projects
Unverified Commit 90c4e983 authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

Merge pull request #114 from noesya/feature/summary-position

Feature : summary position option
parents 75f73f35 2d6b8daa
No related branches found
No related tags found
No related merge requests found
Showing
with 121 additions and 64 deletions
......@@ -80,6 +80,12 @@ $lead-sidebar-size-desktop: px2rem(32) !default
$lead-sidebar-line-height: $lead-line-height !default
$lead-sidebar-weight: $lead-weight !default
$lead-hero-font-family: $lead-sidebar-font-family !default
$lead-hero-size: $lead-size !default
$lead-hero-size-desktop: $lead-sidebar-size-desktop !default
$lead-hero-line-height: $lead-sidebar-line-height !default
$lead-hero-weight: $lead-sidebar-weight !default
// Body
$body-size-desktop: px2rem(22) !default
$body-size: px2rem(18) !default
......
......@@ -21,6 +21,8 @@
h1 + p
margin-top: $spacing1
.lead
@include lead-hero
figure
position: relative
&, img, picture
......
......@@ -118,6 +118,15 @@ h2, .h2
.lead
@include lead
@mixin lead-hero
font-family: $lead-hero-font-family
font-size: $lead-hero-size
font-weight: $lead-hero-weight
line-height: $lead-hero-line-height
@include media-breakpoint-up(desktop)
font-size: $lead-hero-size-desktop
@mixin body-text
font-family: $body-font-family
font-size: $body-size
......
......@@ -52,12 +52,12 @@
aside
order: 2
padding: 0 half($grid-gutter-sm)
margin-bottom: $spacing3
@include media-breakpoint-up(desktop)
.hero
.content
> h1, > hgroup
width: auto
.paper-sidebar
@include container-margin-left
margin-top: 0
......
......@@ -22,12 +22,13 @@ ol.programs
.container
position: relative
&:not(.full-width)
.lead
font-family: $lead-font-family
font-weight: $lead-weight
line-height: $lead-line-height
@include media-breakpoint-up(desktop)
font-size: $lead-size-desktop
.document-content
.lead
font-family: $lead-font-family
font-weight: $lead-weight
line-height: $lead-line-height
@include media-breakpoint-up(desktop)
font-size: $lead-size-desktop
ol.programs
margin-bottom: $spacing3
......
......@@ -4,9 +4,30 @@ params:
enable: false
blank: true
page: https://gdpr.eu/cookies/
plausible: false
seo:
title:
separator: "|"
logo:
header: "/assets/images/logo.svg"
footer: "/assets/images/logo.svg"
breadcrumb:
position: hero-start # hero-start | hero-end | after-hero | none
plausible:
summary:
position: content # content | hero
home:
toc:
disabled: true
organizations:
dark_logo_background: false
pages:
index:
truncate_description: 200 # Set to 0 to disable truncate
partners:
map_marker_icon: '/assets/images/map-marker.svg'
persons:
index:
layout: list # grid | list
posts:
default_image: false
date_format: ":date_long"
......@@ -16,28 +37,9 @@ params:
show_description: true
truncate_description: 200 # Set to 0 to disable truncate
layout: list # grid | list
pages:
index:
truncate_description: 200 # Set to 0 to disable truncate
partners:
map_marker_icon: '/assets/images/map-marker.svg'
persons:
index:
layout: list # grid | list
programs:
related_posts:
quantity: 4
home:
toc:
disabled: true
logo:
header: "/assets/images/logo.svg"
footer: "/assets/images/logo.svg"
organizations:
dark_logo_background: false
seo:
title:
separator: "|"
image_sizes:
design_system:
lightbox:
......@@ -139,10 +141,6 @@ params:
mobile: 400
tablet: 800
desktop: 900
hero_single:
mobile: 400
tablet: 800
desktop: 900
persons:
hero:
mobile: 400
......
......@@ -2,6 +2,11 @@
{{ partial "diplomas/hero-single.html" . }}
<div class="document-content">
{{ partial "posts/summary.html" (dict
"context" .
"block_wrapped" true
) }}
{{ partial "blocks/list.html" . }}
<div class="container">
<ol class="programs">
......
{{ define "main" }}
{{- $title := or .Params.header_text .Title -}}
{{- partial "header/hero.html"
(dict
"title" $title
"image" .Params.image
"sizes" site.Params.image_sizes.sections.papers.hero
"context" .
) -}}
{{ partial "papers/hero.html" . }}
<div class="document-content">
<div class="container">
<ul class="papers">
......
{{ define "main" }}
{{- $title := or .Params.header_text .Title -}}
{{- partial "header/hero.html"
(dict
"title" $title
"subtitle" .Params.summary
"image" .Params.image
"sizes" site.Params.image_sizes.sections.papers.hero_single
"context" .
) -}}
{{ partial "papers/hero.html" . }}
<div class="document-content" itemscope itemtype="https://schema.org/ScholarlyArticle">
<meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}">
{{ partial "papers/sidebar.html" . }}
<div class="container">
<div class="content">
{{ partial "papers/summary.html" . }}
{{ partial "papers/abstract.html" . }}
{{ partial "papers/authors.html" . }}
{{ partial "papers/body.html" . }}
......
{{- partial "commons/summary.html" . -}}
{{- partial "commons/summary-in-content.html" . -}}
{{- $text := (partial "GetTextFromHTML" .context.Params.summary) -}}
{{- if $text -}}
{{ $summary := .summary | default (partial "PrepareText" .context.Params.summary) }}
{{- if eq site.Params.summary.position "content" -}}
{{- if .block_wrapped -}}
<section class="block block-summary">
<div class="container">
......@@ -10,9 +8,7 @@
<div class="container">
{{- end -}}
<p class="lead" role="heading" aria-level="2">
{{ partial "PrepareText" .context.Params.summary }}
</p>
<p class="lead" role="heading" aria-level="2">{{ $summary }}</p>
{{- if .block_wrapped -}}
</div>
......
{{- $title := or .Params.header_text .Title -}}
{{ $subtitle := "" }}
{{- $summary := partial "PrepareText" .Params.summary -}}
{{ if and (eq site.Params.summary.position "hero") $summary }}
{{ $subtitle = $summary }}
{{ end }}
<header class="hero">
<div class="container">
{{- if .Params.breadcrumb | default true -}}
{{ partial "header/breadcrumbs.html" . }}
{{- end -}}
<div class="content">
<h1>{{ partial "PrepareHTML" $title }}</h1>
{{- if $subtitle -}}
<hgroup>
<h1>{{ partial "PrepareHTML" $title }}</h1>
<p class="lead">{{ partial "PrepareHTML" $subtitle }}</p>
</hgroup>
{{- else -}}
<h1>{{ partial "PrepareHTML" $title }}</h1>
{{- end -}}
{{- if .Params.image }}
<figure>
{{ partial "commons/image.html"
......
{{- partial "commons/summary.html" . -}}
{{- partial "commons/summary-in-content.html" . -}}
{{- $direction := "" -}}
{{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}}
{{- $subtitle := .subtitle -}}
{{ if .image }}
{{- $direction = partial "GetImageDirection" .image -}}
{{ end }}
{{- $summary := partial "PrepareText" .context.Params.summary -}}
{{- $subtitle_is_summary := false -}}
{{ if not $subtitle }}
{{ if and (eq site.Params.summary.position "hero") $summary }}
{{ $subtitle = $summary }}
{{ $subtitle_is_summary = true }}
{{ end }}
{{ end }}
<header class="hero {{ if .image -}}hero--with-image hero--image-{{- $direction -}}{{- end }} {{ if $breadcrumb_is_after_hero -}} hero--no-margin {{- end }}">
<div class="container">
{{- if eq site.Params.breadcrumb.position "hero-start" -}}
......@@ -12,10 +23,10 @@
{{- end -}}
{{- end -}}
<div class="content">
{{- if .subtitle -}}
{{- if $subtitle -}}
<hgroup>
<h1>{{ partial "PrepareHTML" .title }}</h1>
<p>{{ partial "PrepareHTML" .subtitle }}</p>
<p {{ if $subtitle_is_summary -}} class="lead" {{- end -}}>{{ partial "PrepareHTML" $subtitle }}</p>
</hgroup>
{{- else -}}
<h1>{{ partial "PrepareHTML" .title }}</h1>
......
{{- partial "commons/summary.html" . -}}
{{- partial "commons/summary-in-content.html" . -}}
{{- partial "commons/summary.html" . -}}
{{- partial "commons/summary-in-content.html" . -}}
{{- partial "commons/summary.html" . -}}
{{- partial "commons/summary-in-content.html" . -}}
{{- $title := or .Params.header_text .Title -}}
{{- partial "header/hero.html"
(dict
"title" $title
"image" .Params.image
"sizes" site.Params.image_sizes.sections.papers.hero
"context" .
) -}}
\ No newline at end of file
{{ $summary := (partial "PrepareText" .Params.summary) }}
{{- if and (eq site.Params.summary.position "content") $summary -}}
<section>
<h2 class="lead">{{ $summary }}</h2>
</section>
{{ end }}
\ No newline at end of file
{{ $subtitle := "" }}
{{- $summary := partial "PrepareText" .Params.summary -}}
{{ if and (eq site.Params.summary.position "hero") $summary }}
{{ $subtitle = $summary }}
{{ end }}
<header class="hero">
<div class="container">
{{- if eq site.Params.breadcrumb.position "hero-start" -}}
{{ partial "header/breadcrumbs.html" . }}
{{- end -}}
<div class="content">
<h1>{{ safeHTML (partial "CorrectPunctuation" .Title) }}</h1>
{{- if $subtitle -}}
<hgroup>
<h1>{{ partial "PrepareHTML" .Title }}</h1>
<p class="lead">{{ partial "PrepareHTML" $subtitle }}</p>
</hgroup>
{{- else -}}
<h1>{{ partial "PrepareHTML" .Title }}</h1>
{{- end -}}
{{ if .Params.image }}
<div class="avatar">
{{ partial "commons/image.html"
......
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