diff --git a/assets/sass/_theme/sections/papers.sass b/assets/sass/_theme/sections/papers.sass index 5e435c4bbbf98a28a049228cbf55ccb86deca4b2..341e9da6f85d93638fe96ba882ac55c2f18268d2 100644 --- a/assets/sass/_theme/sections/papers.sass +++ b/assets/sass/_theme/sections/papers.sass @@ -5,6 +5,7 @@ transition: color 0.3s ease .papers + @include list-reset article @include media-breakpoint-up(desktop) @include grid diff --git a/assets/sass/_theme/sections/volumes.sass b/assets/sass/_theme/sections/volumes.sass index b8ed4aac193a7956e2ed21fdbec48f00c42b1119..24e00c868b15f53eb60f6c7777b00e3f83140edb 100644 --- a/assets/sass/_theme/sections/volumes.sass +++ b/assets/sass/_theme/sections/volumes.sass @@ -96,4 +96,6 @@ dt @include meta &:not(:first-of-type) - margin-top: $spacing2 \ No newline at end of file + margin-top: $spacing2 + .paper + display: block \ No newline at end of file diff --git a/layouts/papers/list.html b/layouts/papers/list.html index 741e7745853824fd91f1c1f435ece82c60f2898c..4453146f2e2d7e8fa3d76391a3650f970311f066 100644 --- a/layouts/papers/list.html +++ b/layouts/papers/list.html @@ -7,7 +7,13 @@ ) -}} <div class="document-content"> <div class="container"> - {{ partial "papers/papers.html" . }} + <ul class="papers"> + {{ range .Paginator.Pages }} + <li> + {{ partial "papers/paper.html" (dict "paper" . ) }} + </li> + {{ end }} + </ul> {{ partial "commons/pagination.html" . }} </div> diff --git a/layouts/partials/papers/paper.html b/layouts/partials/papers/paper.html index 3ebf9d587a72749c86b0e14e6b38f9fb9aa652d1..1143acd7cfb279e71171ede812fe4987bd247a93 100644 --- a/layouts/partials/papers/paper.html +++ b/layouts/partials/papers/paper.html @@ -1,42 +1,48 @@ -<article class="paper" itemscope itemtype="https://schema.org/ScholarlyArticle"> - <div> - <h3> - <a href="{{ .Permalink }}" itemprop="url"> - <span itemprop="name">{{ partial "PrepareHTML" .Title }}</span> - </a> - </h3> - {{- range $index, $authors := .Params.Researchers -}} - {{- $author := site.GetPage (printf "/persons/%s" .) -}} - {{- if ne $index 0 -}},{{ end }} - <span itemprop="author" itemscope itemtype="https://schema.org/Person"><a href="{{ $author.Permalink }}" itemprop="url"><span itemprop="name">{{ trim $author.Title "\n" }}</span></a></span> - {{- end -}} - <p class="paper-volume"> - <span>Article</span> - {{ range .Params.Volumes }} - {{ $volume := site.GetPage (printf "/volumes/%s" .) }} - {{ if $volume }} - {{ i18n "commons.in" }} “<a href="{{ $volume.Permalink }}">{{ $volume.Title }}</a>†- {{ end }} - {{ end }} - </p> - </div> - <div role="group"> - <button type="button" data-bs-toggle="modal">Résumé</button> - <a href="#" download>PDF (435 ko)</a> - {{/* <button type="button" data-bs-toggle="modal" data-bs-target="#{{ $modalId }}">{{ i18n "volumes.abstract" }}</button> - {{ if .Params.pdf }} - {{- $pdf := partial "GetMedia" .Params.pdf -}} - {{- $pdf_size := partial "GetHumanSize" $pdf.size -}} - <a href="{{ $pdf.url }}" download> - {{- i18n "commons.pdf_with_size" (dict "Size" $pdf_size) }} +{{ $inside_volume := .inside_volume | default false }} + +{{ with .paper }} + <article class="paper" itemscope itemtype="https://schema.org/ScholarlyArticle" {{- if $inside_volume }} itemProp="hasPart" {{- end -}}> + <div> + <h3> + <a href="{{ .Permalink }}" itemprop="url"> + <span itemprop="name">{{ partial "PrepareHTML" .Title }}</span> </a> - {{ end }} + </h3> + {{- range $index, $authors := .Params.Researchers -}} + {{- $author := site.GetPage (printf "/persons/%s" .) -}} + {{- if ne $index 0 -}},{{ end }} + <span itemprop="author" itemscope itemtype="https://schema.org/Person"><a href="{{ $author.Permalink }}" itemprop="url"><span itemprop="name">{{ trim $author.Title "\n" }}</span></a></span> + {{- end -}} + <p class="paper-volume"> + <span>Article</span> + {{ if not $inside_volume }} + {{ range .Params.Volumes }} + {{ $volume := site.GetPage (printf "/volumes/%s" .) }} + {{ if $volume }} + {{ i18n "commons.in" }} “<a href="{{ $volume.Permalink }}">{{ $volume.Title }}</a>†+ {{ end }} + {{ end }} + {{ end }} + </p> + </div> + <div role="group"> + <button type="button" data-bs-toggle="modal">Résumé</button> + <a href="#" download>PDF (435 ko)</a> + {{/* <button type="button" data-bs-toggle="modal" data-bs-target="#{{ $modalId }}">{{ i18n "volumes.abstract" }}</button> + {{ if .Params.pdf }} + {{- $pdf := partial "GetMedia" .Params.pdf -}} + {{- $pdf_size := partial "GetHumanSize" $pdf.size -}} + <a href="{{ $pdf.url }}" download> + {{- i18n "commons.pdf_with_size" (dict "Size" $pdf_size) }} + </a> + {{ end }} + </div> + {{ partial "papers/modal.html" + (dict + "modalId" $modalId + "title" .Title + "abstract" .Params.abstract + ) }} */}} </div> - {{ partial "papers/modal.html" - (dict - "modalId" $modalId - "title" .Title - "abstract" .Params.abstract - ) }} */}} - </div> -</article> + </article> +{{ end }} \ No newline at end of file diff --git a/layouts/partials/papers/papers.html b/layouts/partials/papers/papers.html deleted file mode 100644 index c4e8c1c93ff37932516b275ad2694c8ad3334ecb..0000000000000000000000000000000000000000 --- a/layouts/partials/papers/papers.html +++ /dev/null @@ -1,5 +0,0 @@ -<div class="papers"> - {{ range .Paginator.Pages }} - {{ partial "papers/paper.html" . }} - {{ end }} -</div> diff --git a/layouts/partials/persons/papers.html b/layouts/partials/persons/papers.html index 8a0db379c86e70914a1090b49477b01219e8f9f9..904b50f6fcb52be859b577685125093f2afd3c27 100644 --- a/layouts/partials/persons/papers.html +++ b/layouts/partials/persons/papers.html @@ -3,9 +3,11 @@ <div class="top"> <h2><a href="{{ $researchers.Permalink }}">{{ i18n "persons.papers" }}</a></h2> </div> - <div class="papers"> + <ul class="papers"> {{ range first 3 .papers }} - {{ partial "papers/paper.html" . }} + <li> + {{ partial "papers/paper.html" (dict "paper" . ) }} + </li> {{ end }} - </div> + </ul> </section> diff --git a/layouts/partials/volumes/papers.html b/layouts/partials/volumes/papers.html index 9a3b6b9b8716c68abd5941eb412df3890ab381be..edb685a6a878ab22e62af1b5cf899ccf8bd3db12 100644 --- a/layouts/partials/volumes/papers.html +++ b/layouts/partials/volumes/papers.html @@ -2,8 +2,14 @@ <div class="top"> <h2>{{ i18n "volumes.table_contents" }}</h2> </div> - <div class="papers"> - {{ partial "papers/papers.html" (dict - "paper" .) }} - </div> + <ul class="papers"> + {{ range .Paginator.Pages }} + <li> + {{ partial "papers/paper.html" (dict + "paper" . + "inside_volume" true + ) }} + </li> + {{ end }} + </ul> </section> diff --git a/layouts/researchers/term.html b/layouts/researchers/term.html index cff40c27b912857af449d7d60d9cd9a8a4213f4d..2ad94562d93378396872348260e33c03ae6ebb7a 100644 --- a/layouts/researchers/term.html +++ b/layouts/researchers/term.html @@ -5,7 +5,13 @@ "context" . ) -}} <div class="document-content container"> - {{ partial "papers/papers.html" . }} + <ul class="papers"> + {{ range .Paginator.Pages }} + <li> + {{ partial "papers/paper.html" (dict "paper" . ) }} + </li> + {{ end }} + </ul> {{ partial "commons/pagination.html" . }} </div> {{ end }}