You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.1 KiB
54 lines
1.1 KiB
---
|
|
import { SIDEBAR } from "../../config";
|
|
|
|
type Props = {
|
|
section: string;
|
|
language: string;
|
|
};
|
|
const { section, language } = Astro.props as Props;
|
|
---
|
|
|
|
<ul>
|
|
{
|
|
SIDEBAR[language || "en"][section].map((item) => (
|
|
<li>
|
|
{item.links ? (
|
|
<strong>{item.text}</strong>
|
|
<ul>
|
|
{item.links.map((link) => (
|
|
<li>
|
|
<a href={Astro.site?.pathname + link.link}>{link.text}</a>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
) : (
|
|
<a href={Astro.site?.pathname + (item.link ?? item.url)}>{item.text ?? item.title}</a>
|
|
)}
|
|
</li>
|
|
))
|
|
}
|
|
</ul>
|
|
|
|
<style>
|
|
ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
}
|
|
li {
|
|
margin: 0;
|
|
}
|
|
a {
|
|
color: var(--color-text);
|
|
text-decoration: none;
|
|
}
|
|
a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
details {
|
|
margin: 0;
|
|
}
|
|
summary {
|
|
cursor: pointer;
|
|
}
|
|
</style>
|