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

handle summary for persons programs and diplomas

parent 18f56a78
No related branches found
No related tags found
No related merge requests found
Showing
with 71 additions and 41 deletions
...@@ -14,7 +14,7 @@ params: ...@@ -14,7 +14,7 @@ params:
breadcrumb: breadcrumb:
position: hero-start # hero-start | hero-end | after-hero | none position: hero-start # hero-start | hero-end | after-hero | none
summary: summary:
position: content # content | hero position: hero # content | hero
home: home:
toc: toc:
disabled: true disabled: true
...@@ -141,10 +141,6 @@ params: ...@@ -141,10 +141,6 @@ params:
mobile: 400 mobile: 400
tablet: 800 tablet: 800
desktop: 900 desktop: 900
hero_single:
mobile: 400
tablet: 800
desktop: 900
persons: persons:
hero: hero:
mobile: 400 mobile: 400
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<a href="{{ .Permalink }}" class="title" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}"> <a href="{{ .Permalink }}" class="title" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">
{{- $title -}} {{- $title -}}
</a> </a>
{{ if .Params.summary }} {{ if .Params }}
<p class="description"> <p class="description">
{{- partial "PrepareHTML" .Params.summary -}} {{- partial "PrepareHTML" .Params.summary -}}
</p> </p>
......
{{ define "main" }} {{ define "main" }}
{{- $title := or .Params.header_text .Title -}} {{ partial "papers/hero.html" . }}
{{- partial "header/hero.html"
(dict
"title" $title
"image" .Params.image
"sizes" site.Params.image_sizes.sections.papers.hero
"context" .
) -}}
<div class="document-content"> <div class="document-content">
<div class="container"> <div class="container">
<ul class="papers"> <ul class="papers">
......
{{ define "main" }} {{ define "main" }}
{{- $title := or .Params.header_text .Title -}} {{ partial "papers/hero.html" . }}
{{- partial "header/hero.html"
(dict
"title" $title
"subtitle" .Params.summary
"image" .Params.image
"sizes" site.Params.image_sizes.sections.papers.hero_single
"context" .
) -}}
<div class="document-content" itemscope itemtype="https://schema.org/ScholarlyArticle"> <div class="document-content" itemscope itemtype="https://schema.org/ScholarlyArticle">
<meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}">
{{ partial "papers/sidebar.html" . }} {{ partial "papers/sidebar.html" . }}
......
{{- partial "commons/summary-wrapper.html" . -}} {{- partial "commons/summary-in-content.html" . -}}
{{- $title := or .Params.header_text .Title -}} {{- $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"> <header class="hero">
<div class="container"> <div class="container">
{{- if .Params.breadcrumb | default true -}} {{- if .Params.breadcrumb | default true -}}
{{ partial "header/breadcrumbs.html" . }} {{ partial "header/breadcrumbs.html" . }}
{{- end -}} {{- end -}}
<div class="content"> <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 }} {{- if .Params.image }}
<figure> <figure>
{{ partial "commons/image.html" {{ partial "commons/image.html"
......
{{- partial "commons/summary-wrapper.html" . -}} {{- partial "commons/summary-in-content.html" . -}}
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
{{ end }} {{ end }}
{{- $summary := partial "PrepareText" .context.Params.summary -}} {{- $summary := partial "PrepareText" .context.Params.summary -}}
{{- $subtitle_is_summary := false -}}
{{ if not $subtitle }} {{ if not $subtitle }}
{{ if and (eq site.Params.summary.position "hero") $summary }} {{ if and (eq site.Params.summary.position "hero") $summary }}
{{ $subtitle = $summary }} {{ $subtitle = $summary }}
{{ $subtitle_is_summary = true }}
{{ end }} {{ end }}
{{ end }} {{ end }}
...@@ -24,7 +26,7 @@ ...@@ -24,7 +26,7 @@
{{- if $subtitle -}} {{- if $subtitle -}}
<hgroup> <hgroup>
<h1>{{ partial "PrepareHTML" .title }}</h1> <h1>{{ partial "PrepareHTML" .title }}</h1>
<p>{{ partial "PrepareHTML" $subtitle }}</p> <p {{ if $subtitle_is_summary -}} class="lead" {{- end -}}>{{ partial "PrepareHTML" $subtitle }}</p>
</hgroup> </hgroup>
{{- else -}} {{- else -}}
<h1>{{ partial "PrepareHTML" .title }}</h1> <h1>{{ partial "PrepareHTML" .title }}</h1>
......
{{- partial "commons/summary-wrapper.html" . -}} {{- partial "commons/summary-in-content.html" . -}}
{{- partial "commons/summary-wrapper.html" . -}} {{- partial "commons/summary-in-content.html" . -}}
{{- partial "commons/summary-wrapper.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
{{ $subtitle := "" }}
{{- $summary := partial "PrepareText" .Params.summary -}}
{{ if and (eq site.Params.summary.position "hero") $summary }}
{{ $subtitle = $summary }}
{{ end }}
<header class="hero"> <header class="hero">
<div class="container"> <div class="container">
{{- if eq site.Params.breadcrumb.position "hero-start" -}} {{- if eq site.Params.breadcrumb.position "hero-start" -}}
{{ partial "header/breadcrumbs.html" . }} {{ partial "header/breadcrumbs.html" . }}
{{- end -}} {{- end -}}
<div class="content"> <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 }} {{ if .Params.image }}
<div class="avatar"> <div class="avatar">
{{ partial "commons/image.html" {{ partial "commons/image.html"
......
{{- partial "commons/summary-wrapper.html" . -}} {{- partial "commons/summary-in-content.html" . -}}
{{- partial "commons/summary-wrapper.html" . -}} {{- partial "commons/summary-in-content.html" . -}}
{{- $title := or .Params.header_text .Title -}} {{- $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 hero-program"> <header class="hero hero-program">
<div class="container"> <div class="container">
{{- if .Params.breadcrumb | default true -}} {{- if .Params.breadcrumb | default true -}}
{{ partial "header/breadcrumbs.html" . }} {{ partial "header/breadcrumbs.html" . }}
{{- end -}} {{- end -}}
<div class="content"> <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 -}}
</div> </div>
</div> </div>
......
{{- partial "commons/summary-wrapper.html" . -}} {{- partial "commons/summary-in-content.html" . -}}
{{- partial "commons/summary-wrapper.html" . -}} {{- partial "commons/summary-in-content.html" . -}}
...@@ -36,11 +36,9 @@ ...@@ -36,11 +36,9 @@
<div class="informations"> <div class="informations">
<div> <div>
{{ if (partial "GetTextFromHTML" .Params.summary) }} {{ partial "persons/summary.html" (dict
<div class="lead" itemprop="description"> "context" .
{{ partial "PrepareText" .Params.summary }} ) }}
</div>
{{ end }}
{{ if (partial "GetTextFromHTML" .Content) }} {{ if (partial "GetTextFromHTML" .Content) }}
<div class="rich-text"> <div class="rich-text">
{{ partial "PrepareHTML" .Content }} {{ partial "PrepareHTML" .Content }}
......
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