Skip to content

Commit 781870b

Browse files
committed
feat(navigation): add support for external links in navbar, add podcast link
1 parent 8974112 commit 781870b

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

src/_data/navigation.json

+6
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@
1616
"text": "Docs",
1717
"url": "/docs/"
1818
}
19+
],
20+
"external_items": [
21+
{
22+
"text": "Podcast",
23+
"url": "https://podcast.datapack.dev"
24+
}
1925
]
2026
}

src/_includes/layouts/project.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<p>
2222
{% heroicon "outline" "link" "" 'width=16 class="inline mr-0.5 mb-0.5"' %}
2323
<span class="font-bold">Project Page:</span>
24-
<a href="{{ project_link[1] }}">
24+
<a href="{{ project_link[1] }}" target="_blank">
2525
{{ project_link[0] }}{% heroicon "outline" "external-link" "" 'width=10 class="inline ml-0.5 mb-2"' %}
2626
</a>
2727
</p>
@@ -30,7 +30,7 @@
3030
<span class="font-bold">Project Links:</span>
3131
<ul class="ml-[2.25rem] list-disc">
3232
{% for link in other_links %}
33-
<li><a href="{{ link[1] }}">{{ link[0] }}{% heroicon "outline" "external-link" "" 'width=10 class="inline ml-0.5 mb-2"' %}</a></li>
33+
<li><a href="{{ link[1] }}" target="_blank">{{ link[0] }}{% heroicon "outline" "external-link" "" 'width=10 class="inline ml-0.5 mb-2"' %}</a></li>
3434
{% endfor %}
3535
</ul>
3636
{% endif %} {% if docs %}
@@ -47,7 +47,7 @@
4747
<ul class="ml-[2.25rem] list-disc">
4848
{% for author in authors %}
4949
<li>
50-
<a href="{{ author[1] }}" alt="Visit profile of {{ author[0] }}.">
50+
<a href="{{ author[1] }}" alt="Visit profile of {{ author[0] }}." target="_blank">
5151
{{ author[0] }}{% heroicon "outline" "external-link" "" 'width=10 class="inline ml-0.5 mb-2"' %}
5252
</a>
5353
</li>
@@ -64,6 +64,7 @@
6464
<a
6565
href="{{ contributor[1] }}"
6666
alt="Visit profile of {{ contributor[0] }}."
67+
target="_blank"
6768
>
6869
{{ contributor[0] }}{% heroicon "outline" "external-link" "" 'width=10 class="inline ml-0.5 mb-2"' %}
6970
</a>

src/_includes/partials/navigation.html

+15-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,20 @@
88
href="{{ item.url }}"
99
class="no-style hover:gmdu-link font-bold underline decoration-purple-500"
1010
>
11-
{{ item.text }}
11+
{{ item.text }} {% if item.external %}{% heroicon "outline" "external-link"
12+
"" 'width=10 class="inline mb-2"' %}{% endif %}
1213
</a>
1314
</li>
14-
{% endif %} {% endfor %}
15+
{% endif %} {% endfor %} {% if navigation.external_items.size > 0 %}
16+
<span class="hidden xs:inline">|</span>
17+
<hr class="my-4 mx-auto max-w-[10rem] xs:hidden" />
18+
{% endif %} {% for item in navigation.external_items %}
19+
<li>
20+
<a
21+
href="{{ item.url }}"
22+
class="no-style hover:gmdu-link font-bold underline decoration-purple-500"
23+
>
24+
{{ item.text }} {% heroicon "outline" "external-link" "" 'width=10 class="inline mb-2"' %}
25+
</a>
26+
</li>
27+
{% endfor %}

src/_includes/partials/site-header.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
class="relative z-10 flex select-none bg-gradient-to-r from-header-start to-header-end shadow-black xs:shadow sm:shadow-2xl"
33
>
44
<nav
5-
class="flex h-16 grow items-center justify-between gap-4 px-4 text-white"
5+
class="flex h-16 grow items-center justify-between gap-1 px-2 text-white sm:px-4"
66
>
77
<a href="/" class="heading no-style hover:underline">
88
<figure class="flex flex-shrink-0 items-center space-x-1">
@@ -21,7 +21,7 @@
2121
</figcaption>
2222
</figure>
2323
</a>
24-
<ul class="hidden gap-2 text-base leading-8 xs:flex">
24+
<ul class="hidden gap-1 text-base leading-8 xs:flex sm:gap-2">
2525
{% include "partials/navigation.html"%}
2626
</ul>
2727
<div class="xs:hidden">
@@ -60,7 +60,7 @@
6060
<div
6161
class="absolute left-0 top-16 flex w-screen flex-col items-center gap-4 bg-black/40 p-4 text-center backdrop-blur-lg"
6262
>
63-
<ul class="text-2xl">
63+
<ul class="w-full space-y-2 text-center text-2xl">
6464
{% include "partials/navigation.html"%}
6565
</ul>
6666
</div>

0 commit comments

Comments
 (0)