def _get_pages_with_headings(self, pages: Dict) -> Dict:
        '''Update ``pages`` section of ``mkdocs.yml`` file with the content
        of top-level headings of source Markdown files.

        param pages: Dictionary with the data of ``pages`` section

        returns: Updated dictionary
        '''

        def _recursive_process_pages(pages_subset, parent_is_dict):
            if isinstance(pages_subset, dict):
                new_pages_subset = {}
                for key, value in pages_subset.items():
                    if not key:
                        key = self._mkdocs_config.get('default_subsection_title', '…')

                    new_pages_subset[key] = _recursive_process_pages(value, True)

            elif isinstance(pages_subset, list):
                new_pages_subset = []
                for item in pages_subset:
                    new_pages_subset.append(_recursive_process_pages(item, False))

            elif isinstance(pages_subset, str):
                if not parent_is_dict:
                    new_pages_subset = self._get_page_with_optional_heading(pages_subset)

                else:
                    new_pages_subset = pages_subset

            else:
                new_pages_subset = pages_subset

            return new_pages_subset

        new_pages = _recursive_process_pages(pages, False)

        self.logger.debug(f'All pages with their headings: {new_pages}')

        return new_pages