Skip to content
Snippets Groups Projects
Commit a645f22d authored by Moritz Stückler's avatar Moritz Stückler :cowboy:
Browse files

fix: top level news page

parent ca5c7aca
No related branches found
No related tags found
No related merge requests found
Pipeline #7992 passed
import type React from "react";
import React from "react";
import { useState } from "react";
import { Header } from "@fchh/fcos-suite-ui";
import type { IMenuItem, IToolbarItem } from "@interfaces/IMenu";
......
......@@ -2,15 +2,17 @@ import type { IMenuItem } from "@interfaces/IMenu";
import type { MDXInstance } from "astro";
import type { IPage } from "@interfaces/IPage";
import { Home } from "@carbon/icons-react";
/**
* Builds a menu structure from the Filesystem structure given by Astro.glob()
*/
import React from "react";
interface Breadcrumb {
title?: string;
target?: string;
icon?: React.ReactElement;
}
/**
* Builds a menu structure from the Filesystem structure given by Astro.glob()
*/
export const buildPageTree = (
rawContent: MDXInstance<IPage>[],
basePath: string,
......@@ -45,7 +47,11 @@ export const buildPageTree = (
key: localizedKey,
parentKey: localizedParentKey,
title: item.frontmatter.title,
...(index > 1 ? { target: item.url } : {}),
...(index > 1
? { target: item.url }
: item.frontmatter.hideChildren
? { target: item.url }
: {}),
order: item.frontmatter.order || 0,
hideChildren:
!ignoreHidden && (item.frontmatter.hideChildren ?? false),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment