documentation/themes: Refactor for Hugo 0.123.X compatibility
- Simplify path extraction logic in menu partial to match only with the main document/book, enhancing maintainability and future Hugo compatibility.
- Optimize articles and books directory listings by leveraging Hugo's built-in .Sections to fetch content, replacing manual slice construction and sorting logic. This approach streamlines the code and is more idiomatic with recent Hugo versions.
- These changes are part of necessary adjustments for the upgrade to Hugo version 0.123.X, ensuring our theme's compatibility and taking advantage of Hugo's latest features and performance improvements.
Reviewed by: fernape
Differential Revision: https://reviews.freebsd.org/D44284