Use Table Of Contents Web Part To. Please read conclusion of this article to see why this solution didnt meet my requirements. After click OK it is done.
Then click the edit-modify shared web part of the table of content web part. The Table of Contents web part shows on a modern page a table of contents of all headings paragraphs on the page. Table of Contents web part.
The user experience for content authors and home site visitors is identical regardless of which Web Part you use.
Table of Contents web part. This view displays pages and sub-sites off the current site as shown. Open your SharePoint site and go to the page where you want to add this webpart. Updating the Navigation settings only changes the number of subsites listed and changing the webconfig file does not remove these links either.