Skip to content

Commit

Permalink
Adapt publication card to handle missing URLs (#1017)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
maiani authored Dec 19, 2024
1 parent 4e4acdb commit 047bb51
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
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>

0 comments on commit 047bb51

Please sign in to comment.