Skip to content

Commit

Permalink
Merge branch 'main' into add-dark-background
Browse files Browse the repository at this point in the history
  • Loading branch information
BernatBC authored Jan 17, 2025
2 parents 011deb0 + 5c1de70 commit 8debb95
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/scripts/features/darkmode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ function setImages(newScheme) {
if (dark !== null) dark.style.display = 'none'
}
}
}
}
2 changes: 1 addition & 1 deletion assets/scripts/features/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ function setImages(newScheme) {
if (dark !== null) dark.style.display = 'none'
}
}
}
}
20 changes: 19 additions & 1 deletion assets/styles/components/images.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,22 @@ html[data-theme='dark'] {
.company-logo {
max-height: 100%;
width: auto;
}
}

.light-logo {
display: inline;
}

.dark-logo {
display: none;
}

html[data-theme='dark'] {
.light-logo {
display: none;
}

.dark-logo {
display: inline;
}
}
8 changes: 8 additions & 0 deletions assets/styles/sections/publications.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
float: right !important;
}
}

a[href] {
text-decoration: underline; /* Underline only when href is present */
}

a:not([href]) {
text-decoration: none; /* No underline when href is absent */
}
}

.card-body {
Expand Down
14 changes: 13 additions & 1 deletion layouts/partials/cards/publication.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@
<div class="card-header">
<h5 class="card-title mb-0">{{ .title }}</h5>
<div class="sub-title">
<span><a class="" href="{{.publishedIn.url}}">{{ .publishedIn.name }}</a></span>
<span>
{{ if .publishedIn.url }}
<a class="" href="{{.publishedIn.url}}">{{ .publishedIn.name }}</a>
{{ else }}
<a class="">{{ .publishedIn.name }}</a>
{{ end }}
</span>
<span class="ms-2">{{ .publishedIn.date }}</span>
</div>
<div class="authors">
{{ range $index,$author:= .authors }}
{{if .url}}
<span class="me-2"><a class="" href="{{.url}}">{{ .name }}</a></span>
{{ else }}
<span class="me-2"><a class="">{{ .name }}</a></span>
{{ end }}
{{ end }}
</div>
</div>
Expand All @@ -31,9 +41,11 @@ <h5 class="card-title mb-0">{{ .title }}</h5>
</span>
{{ end }}
</div>
{{ if .paper.url }}
<div class="details-btn">
<a class="btn btn-outline-info ms-1 ps-2 mb-2" href="{{ .paper.url }}" target="_blank" rel="noopener" role="button">{{ i18n "project_details"}}</a>
</div>
{{ end }}
</div>
</div>
</div>
4 changes: 4 additions & 0 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@

<link rel="icon" type="image/png" href="{{ $favicon }}" />
{{end}}

{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}
15 changes: 15 additions & 0 deletions layouts/partials/navigators/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{{/* by default, don't use any logo */}}
{{ $mainLogo := "" }}
{{ $invertedLogo := "" }}
{{ $darkLogo := "" }}

{{/* if custom logo has been provided, use them */}}
{{ if site.Params.logo.main }}
Expand All @@ -21,6 +22,9 @@
{{ if site.Params.logo.inverted }}
{{ $invertedLogo = site.Params.logo.inverted }}
{{ end }}
{{ if site.Params.logo.dark }}
{{ $darkLogo = site.Params.logo.dark }}
{{ end }}

{{/* resize the logos. don't resize svg because it is not supported */}}
{{ if $mainLogo }}
Expand All @@ -39,6 +43,14 @@
{{ $invertedLogo = $invertedLogo.RelPermalink}}
{{ end }}

{{ if $darkLogo }}
{{ $darkLogo = resources.Get $darkLogo}}
{{ if and $darkLogo (ne $darkLogo.MediaType.SubType "svg")}}
{{ $darkLogo = $darkLogo.Resize "42x" }}
{{ end }}
{{ $darkLogo = $darkLogo.RelPermalink}}
{{ end }}

{{ $logo := $mainLogo }}
{{ if .IsHome }}
{{ $logo = $invertedLogo }}
Expand Down Expand Up @@ -154,4 +166,7 @@
{{ if $invertedLogo }}
<img src="{{ $invertedLogo }}" class="d-none" id="inverted-logo" alt="Inverted Logo">
{{ end }}
{{ if $darkLogo }}
<img src="{{ $darkLogo }}" class="d-none" id="dark-logo" alt="Dark Logo">
{{ end }}
</nav>

0 comments on commit 8debb95

Please sign in to comment.