diff --git a/assets/sass/_theme/sections/persons.sass b/assets/sass/_theme/sections/persons.sass index 9926c5aa9a5f1a0b4b629f6cbea4e230504a4846..964108658b29afab8f702e94f6973a68d1e8c8b8 100644 --- a/assets/sass/_theme/sections/persons.sass +++ b/assets/sass/_theme/sections/persons.sass @@ -176,8 +176,19 @@ ol.persons--list .blocks margin-top: $spacing3 .person-programs, - .person-objects + .person-objects, + .person-publications margin-top: $spacing4 + .publication + border-bottom: 1px solid $color-border + padding-bottom: $spacing1 + padding-top: $spacing0 + .title + margin-bottom: calc(#{$spacing0}/2) + .ref + color: $color-text-alt + margin-top: 0 + @include small @include media-breakpoint-down(lg) .roles margin-top: $spacing2 diff --git a/i18n/en.yml b/i18n/en.yml index 90f5e8f3f106b546243c14c023452583fbd37cd2..c77712b5272cfe16c5d3921bd026ea169a2b017b 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -150,6 +150,7 @@ pages: persons: posts: News programs: Programs + papers: Papers publications: Publications posts: author: Author diff --git a/i18n/fr.yml b/i18n/fr.yml index 2487a98682868ecf88c8011742a3ad2e14c9e308..4be8ecee642e58b9dc7156183c24aa3e385dc462 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -150,6 +150,7 @@ pages: persons: posts: Actualités publiées programs: Enseignements + papers: Papiers publications: Publications posts: author: Auteur·rice diff --git a/layouts/index.html b/layouts/index.html index 1c7b0e34b339b63c08514e5912ad63ba69e31b97..ee48d39ae32f4e591c01bf3ca6f59fe9412d35de 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -32,6 +32,4 @@ </section> {{ end }} </div> - {{ end }} -{{/* TODO: refacto avec pages/list.html */}} \ No newline at end of file diff --git a/layouts/partials/GetMenu b/layouts/partials/GetMenu index f743ee705db93df4dc4802fa7cd5249becd12a34..5408d56b535001be29e7ffe04ed6494a5ef96b19 100644 --- a/layouts/partials/GetMenu +++ b/layouts/partials/GetMenu @@ -1,13 +1,20 @@ {{ $kind := . }} {{ $menus := index site.Data.menus (printf "%s" site.Language) }} {{ $menu := "" }} -// Try to get menus from the data/menus/<lang> directory +{{/* Try to get menus from the data/menus/<lang> directory */}} {{ if (and $menus (isset $menus $kind)) }} - // Menu found in data/menus/<lang> + {{/* Menu found in data/menus/<lang> */}} {{ $menu = index $menus $kind }} {{ else }} - // Fallback to menu in the data/menus directory + {{/* Fallback to menu in the data/menus directory */}} {{ $menu = index site.Data.menus $kind }} {{ end }} +{{ if reflect.IsSlice $menu }} + {{/* LEGACY */}} + {{ $menu = (dict + "items" $menu + ) }} +{{ end }} + {{ return $menu }} \ No newline at end of file diff --git a/layouts/partials/blocks/templates/pages/cards.html b/layouts/partials/blocks/templates/pages/cards.html index 7ca088c4851bc35834a4e5ad34a32161d3408d1d..30ee5e70794a3149523e0e88c1cff9b91a469a55 100644 --- a/layouts/partials/blocks/templates/pages/cards.html +++ b/layouts/partials/blocks/templates/pages/cards.html @@ -4,10 +4,6 @@ <div class="cards"> {{ range .pages }} {{- $page := partial "GetPageByUrl" .page -}} - {{- if .slug -}} - {{/* LEGACY */}} - {{- $page = partial "GetPageByUrl" .slug -}} - {{- end -}} {{ with $page }} <article class="card"> <h3> diff --git a/layouts/partials/blocks/templates/pages/grid.html b/layouts/partials/blocks/templates/pages/grid.html index a8ff4128d3d9de87d1481ad499a1c46c232c2982..54c096d8c0fc39f816de0ef79d91589aa05a4c3a 100644 --- a/layouts/partials/blocks/templates/pages/grid.html +++ b/layouts/partials/blocks/templates/pages/grid.html @@ -4,15 +4,9 @@ <div class="grid"> {{ range .pages }} {{- $page := false -}} - - {{/* Check if . is a map or page url */}} + {{/* Check if . is a map or page url, necessary when pages/grid is called outside block context */}} {{ if reflect.IsMap . }} - {{- if .page -}} - {{- $page = partial "GetPageByUrl" .page -}} - {{- else if .slug -}} - {{/* LEGACY */}} - {{- $page = partial "GetPageByUrl" .slug -}} - {{ end }} + {{- $page = partial "GetPageByUrl" .page -}} {{ else }} {{- $page = partial "GetPageByUrl" . -}} {{ end }} diff --git a/layouts/partials/blocks/templates/pages/list.html b/layouts/partials/blocks/templates/pages/list.html index f30cb416d2672df18b51fb0562d2d89c035478ed..7f1d103b3fedf403763491f425289418622a9ddc 100644 --- a/layouts/partials/blocks/templates/pages/list.html +++ b/layouts/partials/blocks/templates/pages/list.html @@ -1,10 +1,6 @@ <ul> {{ range .pages }} {{- $page := partial "GetPageByUrl" .page -}} - {{- if .slug -}} - {{/* LEGACY */}} - {{- $page = partial "GetPageByUrl" .slug -}} - {{- end -}} {{ with $page }} <li> <a href="{{- .Permalink -}}"> diff --git a/layouts/partials/commons/menu.html b/layouts/partials/commons/menu.html index 6debde891764e1fef1b2570c6e540c9f3b683e78..531f292ed865f4fd0c5774873782ab493ddfaefd 100644 --- a/layouts/partials/commons/menu.html +++ b/layouts/partials/commons/menu.html @@ -2,7 +2,8 @@ {{ $items := .items }} {{ $context := .context }} {{ if $kind }} - {{ $items = partial "GetMenu" $kind }} + {{ $menu := partial "GetMenu" $kind }} + {{ $items = $menu.items }} {{ end }} {{- $level := .level -}} {{- $stop := .stop -}} diff --git a/layouts/partials/footer/legals.html b/layouts/partials/footer/legals.html index 6f01a6c33fed46456e33ccf63833fe49e2932d5d..9faf4ad75385d6e74eda00c3da605e35719f1969 100644 --- a/layouts/partials/footer/legals.html +++ b/layouts/partials/footer/legals.html @@ -1,12 +1,10 @@ -<div class="footer-legal"> - {{ $menu := partial "GetMenu" "legal" }} - {{ if $menu }} - {{ partial "commons/menu.html" - (dict - "kind" "legal" - "level" 1 - "class" "nav-legal" - )}} - {{ end }} - {{ partial "footer/credit.html" }} -</div> \ No newline at end of file +{{ $menu := partial "GetMenu" "legal" }} +{{ if $menu }} + {{ partial "commons/menu.html" + (dict + "kind" "legal" + "level" 1 + "class" "nav-legal" + )}} +{{ end }} +{{ partial "footer/credit.html" }} diff --git a/layouts/partials/footer/social.html b/layouts/partials/footer/social.html index 0a977cef7eae7a274b51fa93d4c6d802f54d89b2..4b7cb175f65b328a081e31a50adbe295f0e4c890 100644 --- a/layouts/partials/footer/social.html +++ b/layouts/partials/footer/social.html @@ -1,11 +1,10 @@ -<div class="footer-social"> - {{ $menu := partial "GetMenu" "social" }} - {{ if $menu }} - {{ partial "commons/menu.html" - (dict - "kind" "social" - "level" 1 - "class" "nav-social" - )}} - {{ end }} -</div> +{{ $menu := partial "GetMenu" "social" }} +{{ if $menu }} + {{ partial "commons/menu.html" + (dict + "kind" "social" + "level" 1 + "class" "nav-social" + )}} +{{ end }} + diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html index cb886f37287a56fbd65bc672ab0f84793fef4a4b..f0ab7dce143b4e88d003861bd9cff212c7f9dda6 100644 --- a/layouts/partials/header/header.html +++ b/layouts/partials/header/header.html @@ -3,7 +3,6 @@ <nav aria-label="{{ i18n "commons.menu.main" }}"> <div class="container"> {{ partial "header/logo.html" }} - {{ $menu := partial "GetMenu" "primary" }} {{ partial "header/button.html" }} <div class="menu" id="navigation"> {{ partial "commons/menu.html" diff --git a/layouts/partials/persons/papers.html b/layouts/partials/persons/papers.html index 3df613acff8b3d30f87e8f84bbba54e18d0694d1..b0c2a7d3ebaa3e36f0cbab3ac95c9bd6ced9f037 100644 --- a/layouts/partials/persons/papers.html +++ b/layouts/partials/persons/papers.html @@ -1,8 +1,8 @@ {{ $researchers := site.GetPage (printf "/researchers/%s" .slug) }} <section> <div class="top"> - <h2>{{ i18n "persons.publications" }}</h2> - <a href="{{ $researchers.Permalink }}" class="link">{{ i18n "persons.publications" }}</a> + <h2>{{ i18n "persons.papers" }}</h2> + <a href="{{ $researchers.Permalink }}" class="link">{{ i18n "persons.papers" }}</a> </div> <div class="papers"> {{ range first 3 .papers }} diff --git a/layouts/partials/persons/publications.html b/layouts/partials/persons/publications.html new file mode 100644 index 0000000000000000000000000000000000000000..1d6bda5fc96420180680e0d9ccce0f8383d32bb5 --- /dev/null +++ b/layouts/partials/persons/publications.html @@ -0,0 +1,10 @@ +<section class="person-publications"> + <div class="top"> + <h2 class="h5">{{ i18n "persons.publications" }}</h2> + </div> + <div class="publications"> + {{ range . }} + {{ partial "publications/publication.html" . }} + {{ end }} + </div> +</section> diff --git a/layouts/partials/publications/publication.html b/layouts/partials/publications/publication.html new file mode 100644 index 0000000000000000000000000000000000000000..f2dc59dab000f61e7192656c5d6cb835f5bd83db --- /dev/null +++ b/layouts/partials/publications/publication.html @@ -0,0 +1,8 @@ +<article class="publication"> + <p class="title"> + {{ partial "PrepareHTML" .title }} + </p> + <p class="ref"> + {{ partial "PrepareHTML" .ref }} + </p> +</article> diff --git a/layouts/persons/single.html b/layouts/persons/single.html index 9a804cfc4d83810c21b228bfaa92e699557fc9cb..eb83802839dffd17220a57d263f4a561d18d6064 100644 --- a/layouts/persons/single.html +++ b/layouts/persons/single.html @@ -13,6 +13,7 @@ {{ $papersForResearcher = index site.Taxonomies.researchers $slug}} {{ end }} {{ $author := site.GetPage (printf "/authors/%s" $slug) }} + {{ $publications := .Params.publications }} {{ partial "persons/hero-single.html" . }} @@ -80,6 +81,10 @@ {{ if $papersForResearcher }} {{ partial "persons/papers.html" (dict "papers" $papersForResearcher "slug" $slug) }} {{ end }} + + {{ if $publications }} + {{ partial "persons/publications.html" $publications }} + {{ end }} </div> </div> {{ end }} diff --git a/static/osuny-theme-version b/static/osuny-theme-version index 2a7b41fac1afedc1124db02111c81eff166f8077..096c9e3aa7f843377b37ea3e63827b580b9f8b35 100644 --- a/static/osuny-theme-version +++ b/static/osuny-theme-version @@ -1 +1 @@ -v3.1.6 \ No newline at end of file +v3.1.7 \ No newline at end of file