From 047bb517cbee2427b63e35c733becd1430d62206 Mon Sep 17 00:00:00 2001 From: Andrea Maiani Date: Thu, 19 Dec 2024 09:24:52 +0100 Subject: [PATCH 1/3] Adapt publication card to handle missing URLs (#1017) * Allow for personalized titles for Blog and Note pages * Adapt publication card to handle better the case when URL in authors, publication and paper are not used. --- assets/styles/sections/publications.scss | 8 ++++++++ layouts/partials/cards/publication.html | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/assets/styles/sections/publications.scss b/assets/styles/sections/publications.scss index ae76079..e666b3a 100644 --- a/assets/styles/sections/publications.scss +++ b/assets/styles/sections/publications.scss @@ -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 { diff --git a/layouts/partials/cards/publication.html b/layouts/partials/cards/publication.html index 2c238e1..6bf3b89 100644 --- a/layouts/partials/cards/publication.html +++ b/layouts/partials/cards/publication.html @@ -11,12 +11,22 @@
{{ .title }}
- {{ .publishedIn.name }} + + {{ if .publishedIn.url }} + {{ .publishedIn.name }} + {{ else }} + {{ .publishedIn.name }} + {{ end }} + {{ .publishedIn.date }}
{{ range $index,$author:= .authors }} + {{if .url}} {{ .name }} + {{ else }} + {{ .name }} + {{ end }} {{ end }}
@@ -31,9 +41,11 @@ {{ end }} + {{ if .paper.url }}
{{ i18n "project_details"}}
+ {{ end }} From 07372519eee7e164afac394064e84f070e7aa7bd Mon Sep 17 00:00:00 2001 From: Emruz Hossain Date: Tue, 14 Jan 2025 06:01:14 +0600 Subject: [PATCH 2/3] Add support for different logo on dark mode (#1020) --- assets/scripts/features/darkmode/index.js | 2 +- assets/scripts/features/theme/index.js | 2 +- assets/styles/components/images.scss | 20 +++++++++++++++++++- layouts/partials/navigators/navbar.html | 15 +++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/assets/scripts/features/darkmode/index.js b/assets/scripts/features/darkmode/index.js index 74ac8e0..5d8443e 100644 --- a/assets/scripts/features/darkmode/index.js +++ b/assets/scripts/features/darkmode/index.js @@ -67,4 +67,4 @@ function setImages(newScheme) { if (dark !== null) dark.style.display = 'none' } } -} \ No newline at end of file +} diff --git a/assets/scripts/features/theme/index.js b/assets/scripts/features/theme/index.js index 3d7ae08..f845e9d 100644 --- a/assets/scripts/features/theme/index.js +++ b/assets/scripts/features/theme/index.js @@ -85,4 +85,4 @@ function setImages(newScheme) { if (dark !== null) dark.style.display = 'none' } } -} \ No newline at end of file +} diff --git a/assets/styles/components/images.scss b/assets/styles/components/images.scss index 146ea8b..8a35409 100644 --- a/assets/styles/components/images.scss +++ b/assets/styles/components/images.scss @@ -55,4 +55,22 @@ html[data-theme='dark'] { .company-logo { max-height: 100%; width: auto; -} \ No newline at end of file +} + +.light-logo { + display: inline; +} + +.dark-logo { + display: none; +} + +html[data-theme='dark'] { + .light-logo { + display: none; + } + + .dark-logo { + display: inline; + } +} diff --git a/layouts/partials/navigators/navbar.html b/layouts/partials/navigators/navbar.html index bb8274f..704c3ce 100644 --- a/layouts/partials/navigators/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -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 }} @@ -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 }} @@ -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 }} @@ -154,4 +166,7 @@ {{ if $invertedLogo }} {{ end }} + {{ if $darkLogo }} + + {{ end }} From 5c1de702ad86e80778ff8eef51afca7dc261c8ae Mon Sep 17 00:00:00 2001 From: Alexandre Neto Date: Tue, 14 Jan 2025 00:01:42 +0000 Subject: [PATCH 3/3] Add RSS link to header (#1019) Co-authored-by: Emruz Hossain --- layouts/partials/header.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 20c962e..b8858e5 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -18,3 +18,7 @@ {{end}} + +{{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} +{{ end }}