Skip to content
Snippets Groups Projects
Commit 5dfe8afc authored by Arnaud Levy's avatar Arnaud Levy
Browse files

merge main

parents 30b39f61 e64a8f68
No related branches found
No related tags found
No related merge requests found
Showing
with 61 additions and 74 deletions
...@@ -43,11 +43,15 @@ params: ...@@ -43,11 +43,15 @@ params:
single: single:
backlinks: false backlinks: false
pages: pages:
default_image: false
index: index:
truncate_description: 200 # Set to 0 to disable truncate truncate_description: 200 # Set to 0 to disable truncate
papers: papers:
default_image: false
sidebar: sidebar:
direction: start direction: start
volumes:
default_image: false
persons: persons:
index: index:
layout: grid # grid | list layout: grid # grid | list
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<div class="document-content" itemscope itemtype="https://schema.org/Event"> <div class="document-content" itemscope itemtype="https://schema.org/Event">
<meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}">
<meta itemprop="url" content="{{ .Permalink }}"> <meta itemprop="url" content="{{ .Permalink }}">
{{ if .Params.summary }}<meta itemprop="abstract" content="{{ partial "PrepareText" .Params.summary }}">{{ end }} {{ with .Params.summary }}<meta itemprop="abstract" content="{{ . | safeHTML }}">{{ end }}
{{ if .Summary }}<meta itemprop="description" content="{{ partial "PrepareText" .Summary }}">{{ end }} {{ with .Summary }}<meta itemprop="description" content="{{ . | safeHTML }}">{{ end }}
{{ partial "events/sidebar.html" . }} {{ partial "events/sidebar.html" . }}
......
{{ $correct := . }}
{{ $signs := slice ";" ":" "!" "?" }}
{{ range $signs }}
{{ $correct = replace $correct (printf " %s" .) (printf "&#8239;%s" .) }}
{{ end }}
{{ return $correct }}
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
{{ $text = chomp (truncate $length "…" (safeHTML (plainify $text))) }} {{ $text = chomp (truncate $length "…" (safeHTML (plainify $text))) }}
{{ end }} {{ end }}
{{ return (partial "PrepareText" $text) }} {{ return safeHTML ($text) }}
\ No newline at end of file \ No newline at end of file
{{ return {{
safeHTML ( return
chomp ( safeHTML (
partial "CorrectPunctuation" ( partial "FilterIframeLazy" (
partial "FilterIframeLazy" ( .
.
)
) )
) )
) }} }}
{{ $text := . }}
{{ $text = replace $text "\r\n" "\n" }}
{{ $text = replace $text "\r" "\n" }}
{{ $text = replace $text "\n" "<br/>" }}
{{ $text = $text | safeHTML }}
{{ return $text}}
\ No newline at end of file
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<div class="definitions"> <div class="definitions">
{{- range .elements }} {{- range .elements }}
<details itemscope itemtype="https://schema.org/DefinedTerm"> <details itemscope itemtype="https://schema.org/DefinedTerm">
<summary itemprop="name">{{ partial "PrepareText" .title }}</summary> <summary itemprop="name">{{ .title | safeHTML }}</summary>
<p itemprop="description">{{ partial "PrepareText" .description }}</p> <p itemprop="description">{{ .description | safeHTML }}</p>
</details> </details>
{{ end -}} {{ end -}}
</div> </div>
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
"attributes" "class='name' itemprop='name'" "attributes" "class='name' itemprop='name'"
) -}} ) -}}
{{ $heading_tag.open -}} {{ $heading_tag.open -}}
{{ partial "PrepareText" .title }} {{ .title | safeHTML }}
{{ $heading_tag.close -}} {{ $heading_tag.close -}}
<p>{{ partial "PrepareText" .description }}</p> <p>{{ .description | safeHTML }}</p>
</div> </div>
{{- if .image -}} {{- if .image -}}
<figure> <figure>
......
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
{{ end }} {{ end }}
{{ if or .text .credit }} {{ if or .text .credit }}
<figcaption> <figcaption>
{{ if .text }} {{ with .text }}
<p>{{ partial "PrepareText" .text }}</p> <p>{{ . | safeHTML }}</p>
{{ end }} {{ end }}
{{ if .credit }} {{ with .credit }}
<div class="credit">{{ partial "PrepareText" .credit }}</div> <div class="credit">{{ . | safeHTML }}</div>
{{ end }} {{ end }}
</figcaption> </figcaption>
{{ end }} {{ end }}
......
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
{{ if not site.Params.image_sizes.design_system.lightbox.disabled }} {{ if not site.Params.image_sizes.design_system.lightbox.disabled }}
</a> </a>
{{ end }} {{ end }}
{{ if .text }} {{ with .text }}
<figcaption> <figcaption>
<p>{{- partial "PrepareText" .text -}}</p> <p>{{- . | safeHTML -}}</p>
</figcaption> </figcaption>
{{ end }} {{ end }}
</figure> </figure>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
"sizes" site.Params.image_sizes.blocks.pages.list "sizes" site.Params.image_sizes.blocks.pages.list
) -}} ) -}}
{{- else -}} {{- else -}}
{{- partial "commons/image-default.html" -}} {{- partial "commons/image-default.html" "pages" -}}
{{- end -}} {{- end -}}
</div> </div>
{{ end }} {{ end }}
......
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
<div class="media"> <div class="media">
{{- if .Params.image -}} {{- if .Params.image -}}
{{- partial "commons/image.html" {{- partial "commons/image.html"
(dict (dict
"image" .Params.image "image" .Params.image
"sizes" site.Params.image_sizes.sections.posts.item "sizes" site.Params.image_sizes.sections.posts.item
) -}} ) -}}
{{- else if site.Params.posts.default_image -}} {{- else -}}
{{- partial "commons/image-default.html" -}} {{- partial "commons/image-default.html" "posts" -}}
{{- end -}} {{- end -}}
</div> </div>
</article> </article>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
{{ if .file }} {{ if .file }}
{{ $file := partial "GetMedia" .file.id }} {{ $file := partial "GetMedia" .file.id }}
{{ if $file }} {{ if $file }}
<audio src="{{ $file.direct_url }}" controls title="{{ partial "PrepareText" .title }}"></audio> <audio src="{{ $file.direct_url }}" controls title="{{ .title | safeHTML }}"></audio>
{{ end }} {{ end }}
{{ end }} {{ end }}
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<li class="timeline-event"> <li class="timeline-event">
{{ $heading_tag.open -}} {{ $heading_tag.open -}}
{{ partial "PrepareText" .title }} {{ .title | safeHTML }}
{{ $heading_tag.close -}} {{ $heading_tag.close -}}
<div class="line"></div> <div class="line"></div>
<div class="description text">{{- partial "PrepareHTML" .text | markdownify -}}</div> <div class="description text">{{- partial "PrepareHTML" .text | markdownify -}}</div>
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
<div class="timeline-events"> <div class="timeline-events">
{{ range .events -}} {{ range .events -}}
<article class="timeline-event"> <article class="timeline-event">
{{ if .title }} {{ with .title }}
{{ $heading_tag.open -}} {{ $heading_tag.open -}}
{{ partial "PrepareText" .title }} {{ . | safeHTML }}
{{ $heading_tag.close -}} {{ $heading_tag.close -}}
{{ end }} {{ end }}
{{ if .text }} {{ with .text }}
<p>{{ partial "PrepareText" .text }}</p> <p>{{ . | safeHTML }}</p>
{{ end }} {{ end }}
</article> </article>
{{ end -}} {{ end -}}
......
{{- if os.FileExists "static/assets/images/default.png" -}} {{ $section_type := .}}
{{ $file := "/assets/images/default.png" }} {{ $use_default := (index site.Params $section_type).default_image}}
{{ $fileDimensions := partial "GetImageDimensions" (dict "context" . "file" $file "static" true) }} {{ $image := site.Data.website.default_image }}
{{- $lazy := default true .lazy -}}
<img alt="" src="{{ $file }}" width="{{ index $fileDimensions 1 }}" height="{{ index $fileDimensions 0 }}"
{{- if .class }} class="{{ .class }}"{{- end -}}
{{- if $lazy }} loading="lazy"{{- end -}}
>
{{ else if os.FileExists "static/assets/images/default.jpg" }}
{{ $file := "/assets/images/default.jpg" }}
{{ $fileDimensions := partial "GetImageDimensions" (dict "context" . "file" $file "static" true) }}
{{- $lazy := default true .lazy -}}
<img alt="" src="{{ $file }}" width="{{ index $fileDimensions 1 }}" height="{{ index $fileDimensions 0 }}"
{{- if .class }} class="{{ .class }}"{{- end -}}
{{- if $lazy }} loading="lazy"{{- end -}}
>
{{- end -}}
{{ if and $use_default $image }}
{{ with index site.Params.image_sizes.sections $section_type }}
{{ $sizes := .items }}
{{- partial "commons/image.html"
(dict
"image" $image
"sizes" $sizes
) -}}
{{ end }}
{{ end }}
\ No newline at end of file
{{ $summary := .summary | default (partial "PrepareText" .context.Params.summary) }} {{ $summary := .summary | default (.context.Params.summary | safeHTML) }}
{{- if and (eq site.Params.summary.position "content") $summary -}} {{- if and (eq site.Params.summary.position "content") $summary -}}
{{- if .block_wrapped -}} {{- if .block_wrapped -}}
<div class="block block-summary"> <div class="block block-summary">
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</a> </a>
<div class="content"> <div class="content">
<div class="description"> <div class="description">
{{- partial "PrepareText" .Params.summary -}} {{- .Params.summary | safeHTML -}}
</div> </div>
<ol class="programs"> <ol class="programs">
......
{{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}} {{- $breadcrumb_is_after_hero := eq site.Params.breadcrumb.position "after-hero" -}}
{{- $title := or .Params.header_text .Title -}} {{- $title := or .Params.header_text .Title -}}
{{ $subtitle := "" }} {{ $subtitle := "" }}
{{- $summary := partial "PrepareText" .Params.summary -}} {{- $summary := .Params.summary | safeHTML -}}
{{ if and (eq site.Params.summary.position "hero") $summary }} {{ if and (eq site.Params.summary.position "hero") $summary }}
{{ $subtitle = $summary }} {{ $subtitle = $summary }}
{{ end }} {{ end }}
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
{{ else if eq .Params.dates.status "future" }} {{ else if eq .Params.dates.status "future" }}
{{- i18n "blocks.events.future" -}} {{- i18n "blocks.events.future" -}}
{{ else if eq .Params.dates.status "archive" }} {{ else if eq .Params.dates.status "archive" }}
{{- i18n "blocks.events.archive" -}} {{- i18n "blocks.events.archive" -}}
{{ end }} {{ end }}
</p> </p>
{{ end }} {{ end }}
...@@ -81,12 +81,12 @@ ...@@ -81,12 +81,12 @@
<div class="media"> <div class="media">
{{- if .Params.image -}} {{- if .Params.image -}}
{{- partial "commons/image.html" {{- partial "commons/image.html"
(dict (dict
"image" .Params.image "image" .Params.image
"sizes" site.Params.image_sizes.sections.events.item "sizes" site.Params.image_sizes.sections.events.item
) -}} ) -}}
{{- else if site.Params.events.default_image -}} {{- else -}}
{{- partial "commons/image-default.html" -}} {{- partial "commons/image-default.html" "events" -}}
{{- end -}} {{- end -}}
</div> </div>
</article> </article>
......
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