Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion assets/js/theme/design-system/components/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ window.osuny.TableOfContents.prototype.updateScrollspy = function (scroll) {
var container = this.state.isOffcanvas ? this.elements.nav : this.elements.content;
if (this.state.currentLink && scroll > window.innerHeight) {
var progress = this.getAbsoluteOffsetTop(this.state.currentLink) - container.offsetHeight / 2;
progress = this.state.isOffcanvas ? progress : progress - scroll;
var scrollLimit = this.elements.root.offsetTop + window.innerHeight;
if (!this.state.isOffcanvas) {
progress = progress - Math.min(scrollLimit, scroll);
}
container.scrollTo({
top: progress
});
Expand Down
2 changes: 2 additions & 0 deletions assets/sass/_theme/design-system/layout.sass
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ ol
@include in-page-with-sidebar
.heading h2, .block .block-content
padding-left: offset(4)
.section-sidebar
margin-top: 0

details
&:not([open]):hover
Expand Down
2 changes: 1 addition & 1 deletion assets/sass/_theme/design-system/meta.sass
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
&:not(:first-child)
padding-top: $spacing-2
border-top: var(--border-width) solid var(--color-border)
> ul
> ul, > :last-child
text-align: right
&.taxonomies
padding-top: 0
Expand Down
7 changes: 7 additions & 0 deletions assets/sass/_theme/design-system/single/sidebar.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.section-sidebar
@include in-page-with-sidebar
@include sidebar
@include in-page-without-sidebar
@include aside-full-width
@include media-breakpoint-down(desktop)
@include container
5 changes: 4 additions & 1 deletion assets/sass/_theme/design-system/table_of_contents.sass
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@
.toc-content
overflow-y: auto
max-height: calc(100vh - var(--header-height))
padding-top: var(--grid-gutter)
margin-top: var(--grid-gutter-negative)
padding-bottom: $spacing-4
pointer-events: auto
@include sticky($spacing-3)
transition: top $header-sticky-transition, max-height $header-sticky-transition
html.is-scrolling-down &
max-height: calc(100vh - #{$spacing-3})
max-height: calc(100vh)
.toc-title
color: var(--color-text-alt)
button
Expand Down
1 change: 1 addition & 0 deletions assets/sass/_theme/hugo-osuny.sass
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
@import design-system/offcanvas
@import design-system/pagination
@import design-system/print
@import design-system/single/sidebar
@import design-system/table
@import design-system/table_of_contents
@import design-system/taxonomies
Expand Down
3 changes: 0 additions & 3 deletions assets/sass/_theme/sections/events/single.sass
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
&.image-square
width: columns(6)
@include h3
&:not(.full-width)
.section-sidebar
@include sidebar
.programme-btn
@extend .button--alt
@extend .button--small
Expand Down
14 changes: 0 additions & 14 deletions assets/sass/_theme/sections/jobs.sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,3 @@
+ time
&::before
content: ''

// sidebar
.jobs__page
&:not(.full-width)
.section-sidebar
@include sidebar

&.full-width
.job-sidebar
@include media-breakpoint-down(desktop)
@include container

@include media-breakpoint-up(desktop)
@include aside-full-width
21 changes: 6 additions & 15 deletions assets/sass/_theme/sections/organizations.sass
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,8 @@
margin-top: $spacing-4

.organizations__page
.lead
font-family: $lead-sidebar-font-family
font-weight: $lead-sidebar-weight
line-height: $lead-sidebar-line-height
margin-bottom: $spacing-3
@include media-breakpoint-up(desktop)
font-size: $lead-sidebar-size-desktop
.document-content
[itemprop="articleBody"] + .organization-logo
.organization-presentation + .organization-logo
figcaption
text-align: right
@include meta
Expand All @@ -147,6 +140,9 @@
margin-top: 0
&:not(:first-child)
margin-top: $spacing-5
&:not(.full-width)
.organization-presentation
padding-left: offset(4)
@include media-breakpoint-down(md)
.document-content
.organization-logo
Expand All @@ -159,12 +155,7 @@
display: flex
justify-content: space-between
gap: var(--grid-gutter)
[itemprop="articleBody"]
.organization-presentation
width: columns(8)
+ .organization-logo
width: columns(3)
.contacts-details
ul
@include grid(2)
li
margin-top: 0
width: columns(3)
40 changes: 20 additions & 20 deletions assets/sass/_theme/sections/persons/single.sass
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
.blocks
margin-top: $spacing-5
.person-objects
margin-top: $spacing-5
> * + *
margin-top: $spacing-5
.top h2 a
Expand Down Expand Up @@ -99,25 +98,26 @@
@include small
&:hover
color: var(--color-accent)

@include media-breakpoint-down(lg)
.roles
margin-top: $spacing-4
@include media-breakpoint-up(lg)
.informations
@include grid
margin-bottom: $spacing-4
.roles
grid-column: 1 / -1
.biography
grid-column: 1 / 9
+ .roles
grid-column: 9 / 13
text-align: right
.lead + div
margin-top: $spacing-4
@include media-breakpoint-up(md)
.contacts-details
ul
@include grid(3)
li
margin-top: 0

@include media-breakpoint-up(desktop)
&.full-width
.informations
@include grid
margin-bottom: $spacing-4
.roles
grid-column: 1 / -1
.biography
grid-column: 1 / 9
+ .roles
grid-column: 9 / 13
text-align: right
.lead + div
margin-top: $spacing-4
&:not(.full-width)
.informations,
.person-objects
padding-left: offset(4)
11 changes: 0 additions & 11 deletions assets/sass/_theme/sections/posts.sass
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,6 @@
// Safe spacing if post is empty
.document-content
@include document-min-height(600px)
&:not(.full-width)
.post-sidebar
@include sidebar
.block-signatures
.signatures
border-top: var(--border-width) solid var(--color-border)
Expand Down Expand Up @@ -263,14 +260,6 @@
+ li
margin-top: $spacing-3

&.full-width
.post-sidebar
@include media-breakpoint-down(desktop)
@include container

@include media-breakpoint-up(desktop)
@include aside-full-width

.related
margin-top: $spacing-3
.posts
Expand Down
13 changes: 0 additions & 13 deletions assets/sass/_theme/sections/projects.sass
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,6 @@
flex-wrap: wrap
li
white-space: nowrap

&:not(.full-width)
.project-sidebar
@include sidebar

&.full-width
.project-sidebar
@include media-breakpoint-down(desktop)
@include container

@include media-breakpoint-up(desktop)
@include aside-full-width

@include media-breakpoint-up(sm)
.hero
.project-infos
Expand Down
25 changes: 12 additions & 13 deletions assets/sass/_theme/utils/sidebar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@
@content

@mixin sticky($offset-y: 0px)
--sticky-offset-y: #{$offset-y}
position: sticky
top: $offset-y
top: var(--sticky-offset-y)
@if $header-sticky-enabled
transition: top $header-sticky-transition
html:not(.is-scrolling-down) &
top: calc(var(--header-height) + #{$offset-y})
top: calc(var(--header-height) + var(--sticky-offset-y))

@mixin sidebar($side: start)
@include media-breakpoint-down(desktop)
Expand All @@ -58,25 +59,23 @@
height: 100%
position: absolute
width: columns(4)
& > div
@include sticky($spacing-3)
.toc-container
position: static
@include sticky
height: auto
margin-left: 0
&:has(aside)
.toc-container
border-top: var(--border-width) solid var(--color-border)
padding-top: $spacing-3
&.section-sidebar--with-toc
.meta-container
margin-bottom: var(--grid-gutter)

@mixin aside-full-width
@include container
> div
align-items: baseline
display: flex
margin-bottom: $spacing-5
align-items: baseline
display: flex
margin-bottom: $spacing-5
.toc-cta
margin-bottom: 0
padding-right: 0
padding-left: 0
aside
flex-shrink: 0
@include media-breakpoint-down(desktop)
Expand Down
8 changes: 4 additions & 4 deletions bin/osuny.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ let pagefindExclude = `
.block-projects,
.block-publications,
.block-volumes,
.persons-papers,
.persons-posts,
.persons-programs,
.persons-publications,
.person-papers,
.person-posts,
.person-programs,
.person-publications,
.post-sidebar,
.events,
.exhibitions,
Expand Down
15 changes: 15 additions & 0 deletions layouts/_partials/commons/section/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ $with_toc := partial "toc/helpers/IsPresent" .context }}
{{ $class := partial "commons/single/sidebar/helpers/GetClass" (dict
"with_meta" false
"with_toc" $with_toc
"context" .context
) }}

{{ if $with_toc }}
<div class="{{ $class }}">
{{ partial "toc/container.html" (dict
"context" .context
"toc" .toc
) }}
</div>
{{ end }}
18 changes: 10 additions & 8 deletions layouts/_partials/commons/single/meta.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{{ $meta_class := partial "commons/single/meta/helpers/GetMetaClass" . }}

<ul class="{{ $meta_class }}">
{{ partial "commons/single/meta/taxonomies.html" . }}
{{ partial "commons/single/meta/dates.html" . }}
{{ partial "commons/single/meta/authors.html" . }}
{{ partial "commons/single/meta/reading-time.html" . }}
{{ partial "commons/single/meta/share.html" . }}
</ul>
{{ $has_content := partial "commons/single/meta/helpers/HasContent" . }}
{{ if $has_content }}
<ul class="{{ $meta_class }}">
{{ partial "commons/single/meta/taxonomies.html" . }}
{{ partial "commons/single/meta/dates.html" . }}
{{ partial "commons/single/meta/authors.html" . }}
{{ partial "commons/single/meta/reading-time.html" . }}
{{ partial "commons/single/meta/share.html" . }}
</ul>
{{ end }}
7 changes: 2 additions & 5 deletions layouts/_partials/commons/single/meta/authors.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{{ $with_authors := partial "helpers/param/GetSiteParamWithDefault" (dict
"param" (printf "%s.single.meta.options.authors" .Type)
"default" "default.single.meta.options.authors"
) }}
{{ $has_authors := partial "commons/single/meta/helpers/has/Authors" . }}

{{ if $with_authors }}
{{ if $has_authors }}
{{ partial "authors/partials/authors.html" . }}
{{ end }}
18 changes: 18 additions & 0 deletions layouts/_partials/commons/single/meta/contacts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ $has_contacts := partial "commons/single/meta/helpers/has/Contacts" . }}
{{ $name := .Title }}
{{ $with_labels := partial "commons/single/meta/helpers/WithLabels" . }}
{{ with $has_contacts }}
{{ if or .websites .social_networks .emails .phone_numbers .phone_professional }}
{{ partial "commons/contact-details/links.html" (dict
"context" .
"name" $name
"with_labels" $with_labels
) }}
{{ end }}
{{ if .postal_address }}
{{ partial "commons/contact-details/address.html" (dict
"postal_address" .postal_address
"with_labels" $with_labels
) }}
{{ end }}
{{ end }}
Loading
Loading