Skip to content

Commit aa134d2

Browse files
committed
feat(navbar): enhance navbar links with external link icons
Added support for external links in the navbar by including an icon for links that lead to external URLs. Updated the CSS to style the icons appropriately.
1 parent 2a8c60f commit aa134d2

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

assets/css/main.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,13 @@ header {
424424
color: var(--text-color-light);
425425
}
426426

427+
.navbar .nav-links i {
428+
/* margin-left: 4px; */
429+
font-size: 0.6em;
430+
vertical-align: super;
431+
color: var(--text-color-light);
432+
}
433+
427434
/* remove trailing icon for links with a img inside */
428435
.no-trailing-icon::after {
429436
content: none !important;

layouts/partials/navbar.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@
66
<div class="nav-links">
77
{{ range .Site.Menus.main }}
88
<div class="nav-item">
9-
10-
<a href="{{ .URL }}" class="nav-link">
11-
{{ .Name }}
12-
</a>
9+
{{ if hasPrefix .URL "http" }}
10+
<a href="{{ .URL }}" class="nav-link" target="_blank">
11+
{{ .Name }}
12+
<i class="fa-solid fa-arrow-up-right-from-square"></i>
13+
</a>
14+
{{ else }}
15+
<a href="{{ .URL }}" class="nav-link">
16+
{{ .Name }}
17+
</a>
18+
{{ end }}
1319
</div>
1420
{{ end }}
1521
</div>

0 commit comments

Comments
 (0)