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