message: fix(theme): fix `index: false` not working
diff: @@ -120,16 +120,13 @@ const getInfo = async (
  "index" in dirInfo
  ? (dirInfo.index as number | boolean)
  : null,
  - children: (dirInfo.link
  + children: dirInfo.link
  ? // filter README.md
  result.filter(
  (item) =>
  item.type !== "file" || item.path !== "README.md"
  )
  - : result
  - )
  - // items with `index: false` should be dropped here
  - .filter((item) => item.index !== false),
  + : result,
  };
  }
  @@ -176,9 +173,21 @@ const getInfo = async (
  return [];
  }
  )
  - .then((items) =>
  + .then(
  + (items) =>
  // dir without README.md should be dropped here
  - (items.filter((item) => item !== null) as Info[])
  + items.filter((item) => item !== null) as Info[]
  + );
  +
  + return result;
  +};
  +
  +const getSidebarItems = (
  + infos: Info[]
  +): (HopeThemeSidebarGroupItem | string)[] =>
  + infos
  + // items with `index: false` should be dropped here
  + .filter((item) => item.index !== false)
  // sort items
  .sort((itemA: Info, itemB: Info) => {
  // check README.md, it should be first one
  @@ -198,19 +207,9 @@ const getInfo = async (
  // compare title
  return (
  itemA.type === "file" ? itemA.title : itemA.info.text
  - ).localeCompare(
  - itemB.type === "file" ? itemB.title : itemB.info.text
  - );
  + ).localeCompare(itemB.type === "file" ? itemB.title : itemB.info.text);
  })
  - );
  -
  - return result;
  -};
  -
  -const getSidebarItems = (
  - infos: Info[]
  -): (HopeThemeSidebarGroupItem | string)[] =>
  - infos.map((info) => {
  + .map((info) => {
  if (info.type === "file") return info.path;
  return {
  