diff --git a/assets/sass/_theme/sections/papers.sass b/assets/sass/_theme/sections/papers.sass index 81ec014cfb51ba0e2e4b865cfc44c7b4389ce1aa..d8d6f1539c466edb3faef019e174ffbdbf89cd40 100644 --- a/assets/sass/_theme/sections/papers.sass +++ b/assets/sass/_theme/sections/papers.sass @@ -66,17 +66,22 @@ height: 100% position: absolute width: col-outside-container(4) - // > div - // @include sticky($spacing1) + > div + height: 100% + position: relative + aside + border-bottom: 1px solid $color-border + padding-bottom: $spacing1 .toc-container - border-top: 1px solid $color-border - padding-top: $spacing1 - position: static + height: unset margin-left: 0 + padding-top: $spacing1 + @include sticky(-1px) .media width: col(2, 4) .document-content + min-height: 100vh .content margin-bottom: $spacing4 @include media-breakpoint-up(desktop) diff --git a/i18n/en.yml b/i18n/en.yml index 56550f95089d4b38428c219ef194d758e6c12ddb..be31ab2038a06503f9f118fcd5ddcfc08fb91ce3 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -157,6 +157,11 @@ papers: accepted: Accepted received: Received download: Download + toc: + abstract: Abstract + researchers: Authors + references: References + content: Content persons: posts: News programs: Programs diff --git a/i18n/fr.yml b/i18n/fr.yml index 80833e3df562e7a5d293b857dfb8c8290ca631fd..37dc88ea9e13a6b6061642c1014fc848c1199c79 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -157,6 +157,11 @@ papers: accepted: Date d'acceptation received: Date de réception download: Téléchargement + toc: + abstract: Abstract + researchers: Auteurs + references: Références + content: Texte intégral persons: posts: Actualités publiées récemment programs: Enseignements diff --git a/layouts/partials/papers/abstract.html b/layouts/partials/papers/abstract.html index b5259b11433fff82d58d9911c5c00d7f6ab67db0..a4b7bb1392fe06689b18f6d18c2fd43b43dd88be 100644 --- a/layouts/partials/papers/abstract.html +++ b/layouts/partials/papers/abstract.html @@ -1,13 +1,15 @@ -<section class="paper-essentials"> +<section class="paper-essentials" id="abstract"> {{ with .Params.Abstract }} <h2>{{ i18n "papers.abstract" }}</h2> <p itemprop="abstract">{{ partial "PrepareHTML" . }}</p> {{ end }} - <h2>{{ i18n "papers.download" }}</h2> - <div role="group"> - {{ partial "papers/actions.html" (dict - "paper" . - "only_file" true - ) }} - </div> + {{ if .Params.Pdf }} + <h2>{{ i18n "papers.download" }}</h2> + <div role="group"> + {{ partial "papers/actions.html" (dict + "paper" . + "only_file" true + ) }} + </div> + {{ end }} </section> diff --git a/layouts/partials/papers/authors.html b/layouts/partials/papers/authors.html index 95763e57e20f3ccd5159d67f914d3012661dc0b6..69df57a6b9dd12966c4988f407d129bcae453efc 100644 --- a/layouts/partials/papers/authors.html +++ b/layouts/partials/papers/authors.html @@ -1,5 +1,5 @@ {{ if .Params.Researchers }} - <section class="paper-authors"> + <section class="paper-authors" id="authors"> <h2>{{ i18n "volumes.authors" }}</h2> <div class="authors"> {{ range .Params.Researchers }} diff --git a/layouts/partials/papers/references.html b/layouts/partials/papers/references.html index 8f9e163214da4adfc695ccb701c3d94aaa037c29..704a76b153e6a2f0dc387317c05569240d6a2b92 100644 --- a/layouts/partials/papers/references.html +++ b/layouts/partials/papers/references.html @@ -1,5 +1,5 @@ {{ with .Params.references }} - <section> + <section id="references"> <h2>{{ i18n "volumes.references" }}</h2> {{ partial "PrepareHTML" . }} </section> diff --git a/layouts/partials/papers/sidebar.html b/layouts/partials/papers/sidebar.html index 8dfd8b50d58bdf78909ba0ea8e74534eaf80c79b..d9bc295697b4f75ccc7c4d7d3c3e509321371995 100644 --- a/layouts/partials/papers/sidebar.html +++ b/layouts/partials/papers/sidebar.html @@ -64,6 +64,12 @@ {{ end }} </dl> </aside> + {{ partial "toc/container.html" + (dict + "toc" "papers/toc.html" + "context" . + ) + }} </div> </div> diff --git a/layouts/partials/papers/toc.html b/layouts/partials/papers/toc.html new file mode 100644 index 0000000000000000000000000000000000000000..33a92bce1ffa09da788b90750d828f9aa3473955 --- /dev/null +++ b/layouts/partials/papers/toc.html @@ -0,0 +1,26 @@ +{{ $content := .context.Content }} +{{ $references := .context.Params.References }} +{{ $researchers := .context.Params.researchers }} +{{ $abstract := .context.Params.Abstract }} +{{ $blocks := .context.Params.blocks}} + +<nav class="toc" id="nav-toc" aria-label="{{ i18n "commons.toc" }}"> + <ol> + {{- if $abstract -}} + <li><a href="#abstract">{{ i18n "papers.toc.abstract" }}</a></li> + {{- end -}} + {{- if $researchers -}} + <li><a href="#authors">{{ i18n "papers.toc.researchers" }}</a></li> + {{- end -}} + {{- if $content -}} + <li><a href="#full-text">{{ i18n "papers.toc.content" }}</a></li> + {{- end -}} + {{- if $references -}} + <li><a href="#references">{{ i18n "papers.toc.references" }}</a></li> + {{- end -}} + {{- if $blocks -}} + {{- partial "blocks/toc.html" $blocks -}} + {{- end -}} + </ol> + </nav> + \ No newline at end of file