Navigation links sorting change: index file are always on top.

Markdown content: If the content don't includes a h1, the title is render at the beginning of the page
This commit is contained in:
2024-03-14 17:45:39 +01:00
parent 7b2c74c405
commit 9c222edcdf
2 changed files with 15 additions and 2 deletions

View File

@@ -17,6 +17,17 @@ const hasChildren = computed(() => {
return props.link && props.link.children && props.link.children.length > 0 || false;
});
if(hasChildren.value)
{
props.link.children?.sort((a, b) => {
if(a._path === props.link._path)
return -1;
if(b._path === props.link._path)
return 1;
return 0;
});
}
const collapsed = ref(!useRoute().path.startsWith(props.link._path));
</script>