re-add qtquick types and qs examples links to nav

This commit is contained in:
outfoxxed 2024-10-24 20:17:34 -07:00
parent a5c4272469
commit bc01642fa4
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
5 changed files with 36 additions and 22 deletions

View file

@ -428,23 +428,3 @@ export const LoadingSpinner: VoidComponent<{
</svg>
);
};
export const LinkSimple: VoidComponent<{
class?: string;
}> = props => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 256 256"
class={props.class}
>
<title>Link</title>
<path
fill="currentColor"
d="M165.66 90.34a8 8 0 0 1 0 11.32l-64 64a8 8 0 0 1-11.32-11.32l64-64a8 8 0 0 1 11.32 0M215.6 40.4a56 56 0 0 0-79.2 0l-30.06 30.05a8 8 0 0 0 11.32 11.32l30.06-30a40 40 0 0 1 56.57 56.56l-30.07 30.06a8 8 0 0 0 11.31 11.32l30.07-30.11a56 56 0 0 0 0-79.2m-77.26 133.82l-30.06 30.06a40 40 0 1 1-56.56-56.57l30.05-30.05a8 8 0 0 0-11.32-11.32L40.4 136.4a56 56 0 0 0 79.2 79.2l30.06-30.07a8 8 0 0 0-11.32-11.31"
/>
</svg>
);
};

View file

@ -1,10 +1,22 @@
---
import { Icon } from "astro-icon/components";
interface Props {
title: string;
link: string;
current?: boolean;
showIcon?: boolean;
}
const { title, link, current } = Astro.props;
const { title, link, current, showIcon } = Astro.props;
---
<a class=`nav-component nav-item nav-link ${current ? "nav-current" : ""}` href={link}>{title}</a>
<a class=`nav-component nav-item nav-link ${current ? "nav-current" : ""}` href={link}>
{ showIcon ? (
<div>
<Icon name="link"/>
{title}
</div>
) : (
title
)}
</a>

View file

@ -10,6 +10,7 @@ const { currentRoute, currentModule, currentClass } = Astro.props;
import { getTypeData } from "@config/io/generateTypeData";
import { groupRoutes } from "@config/io/helpers";
import Tree from "./Tree.astro";
import Link from "./Link.astro";
const routes = await getTypeData();
const groupedRoutes = groupRoutes(routes);
@ -48,4 +49,14 @@ const types = {
<nav class="navtree">
<Tree {...configuration}/>
<Tree {...types}/>
<Link
title="QtQuick Types"
link="https://doc.qt.io/qt-6/qtquick-qmlmodule.html"
showIcon={true}
/>
<Link
title="Quickshell Examples"
link="https://git.outfoxxed.me/outfoxxed/quickshell-examples"
showIcon={true}
/>
</nav>

2
src/icons/link.svg Normal file
View file

@ -0,0 +1,2 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 256 256"><path fill="currentColor" d="M165.66 90.34a8 8 0 0 1 0 11.32l-64 64a8 8 0 0 1-11.32-11.32l64-64a8 8 0 0 1 11.32 0M215.6 40.4a56 56 0 0 0-79.2 0l-30.06 30.05a8 8 0 0 0 11.32 11.32l30.06-30a40 40 0 0 1 56.57 56.56l-30.07 30.06a8 8 0 0 0 11.31 11.32l30.07-30.11a56 56 0 0 0 0-79.2m-77.26 133.82l-30.06 30.06a40 40 0 1 1-56.56-56.57l30.05-30.05a8 8 0 0 0-11.32-11.32L40.4 136.4a56 56 0 0 0 79.2 79.2l30.06-30.07a8 8 0 0 0-11.32-11.31"/></svg>

After

Width:  |  Height:  |  Size: 527 B

View file

@ -4,6 +4,15 @@
.nav-link {
text-decoration: none !important;
& div {
display: flex;
flex-direction: row;
align-items: center;
gap: 0.3em;
& svg { color: hsl(var(--text)) }
}
}
.nav-item {