def METHOD_NAME(cls, base_path: Path, page_order: list[str]) -> list[Page]:
    output: list[Page] = []
    for path in base_path.glob("**/*.md"):
        relative = path.relative_to(base_path)
        language = relative.parts[0]
        name = "/".join(relative.parts[1:])
        page = cls._load_page(path)
        output.append(page)
        page._relative_path = relative
        _PAGE_CACHE.setdefault(language, {})[name] = (
            None,
            page,
            None,
        )
        _PAGE_CACHE["api"] = {}
    for language, pages in _PAGE_CACHE.items():
        for name, (_, current, _) in pages.items():
            previous_page = None
            next_page = None
            try:
                index = page_order.index(name)
            except ValueError:
                continue
            try:
                if index > 0:
                    previous_page = pages[page_order[index - 1]][1]
            except KeyError:
                pass
            try:
                if index < len(page_order) - 1:
                    next_page = pages[page_order[index + 1]][1]
            except KeyError:
                pass
            pages[name] = (previous_page, current, next_page)
        previous_page = None
        next_page = None
    api_pages = cls._load_api_pages()
    filtered_order = [ref for ref in page_order if ref in api_pages]
    for idx, ref in enumerate(filtered_order):
        current_page = api_pages[ref]
        previous_page = None
        next_page = None
        try:
            if idx > 0:
                previous_page = api_pages[filtered_order[idx - 1]]
        except KeyError:
            pass
        try:
            if idx < len(filtered_order) - 1:
                next_page = api_pages[filtered_order[idx + 1]]
        except KeyError:
            pass
        _PAGE_CACHE["api"][ref] = (previous_page, current_page, next_page)
    return output