-
Notifications
You must be signed in to change notification settings - Fork 7
/
Section.astro
43 lines (38 loc) · 1.09 KB
/
Section.astro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
import Icon from "../../elements/Icon.astro";
import { normalizeUrl } from "../../../util/url";
interface Props {
section: NavSection;
}
const { section } = Astro.props;
const { title, links } = section;
const t = (x: any) => x;
---
<div class="nav section container">
<h4 class="title">{t(title)}</h4>
<div class="content">
{
links &&
links.map((link) => (
<a
class="item container"
href={normalizeUrl(link.href)}
target={link.isExternal ? "_blank" : undefined}
data-include-theme={link.includeTheme ? true : null}
>
{link.icon && <Icon size={"md"} variant={link.icon} />}
<div>
<h3 class="title">
{t(link.title)}
{link?.badge && <div class="badge">{link.badge}</div>}{" "}
{link.isExternal && (
<Icon size={"sm"} variant="link-external-01" />
)}{" "}
</h3>
<p class="description">{t(link.text)}</p>
</div>
</a>
))
}
</div>
</div>