1. <https://docs.freebsd.org/en/books/faq/> 2. under Resources, click Single HTML Expected: 3. if the initial view was truly split, a switch from split to single Actual result: 3. <https://docs.freebsd.org/en/books/faq/book/> 404 not found
^Triage: reporter is committer, assign accordingly.
Help, please! I have _NO_ idea how to patch things such as this.
The reason this happens is that the theme generates a single HTML link that is hardcoded to the `book.adoc` file in a given directory. This file includes all chapters to present everything in a single page. However, for pages like the FAQ and the dev-model, this is unnecessary. These are already single page documents. You have a few ways to handle this: 1. Create a `book.adoc` file that contains all the content from the index page (don't do this). 2. Update the theme and add a frontmatter parameter which allows the editor to hide the single page link when it's not necesssary. 3. Find some way to inform Hugo when there's no book file and have it simply route the user back to the main page when they click the link. Of these, 2 is by far the easiest to implement as we can just add a parameter like `show_single_page: false` to the frontmatter of single page docs and the theme won't show the link, thereby avoiding the confusion. If this sounds like an agreeable solution, let me know and I'll put a patch in.
Created attachment 239746 [details] Use single page layout for one page books Looking at this again, I can see this issue affects the following books: 1. The Design and Implementation of the 4.4BSD Operating System: https://docs.freebsd.org/en/books/design-44bsd/ 2. A project model for the FreeBSD Project: https://docs.freebsd.org/en/books/dev-model/ 3. Frequently Asked Questions for FreeBSD 12.X and 13.X: https://docs.freebsd.org/en/books/faq/ This patch takes the following steps to address the issue: 1. Updates the "single.html" template used for one page books to remove the link to the single HTML page (this is redundant when you're already in the single HTML view and just refreshes the page) 2. Applies the "single.html" template on single-page books using the "layout: single" frontmatter parameter.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/doc/commit/?id=34aaac36f56c4b56a168d9f392f5bc2a25998a63 commit 34aaac36f56c4b56a168d9f392f5bc2a25998a63 Author: Ciarán Ainsworth <ciaranainsworth@posteo.net> AuthorDate: 2023-01-28 08:53:27 +0000 Commit: Sergio Carlavilla Delgado <carlavilla@FreeBSD.org> CommitDate: 2023-01-28 08:53:27 +0000 Fix single page problem in FAQ, dev-model and design-44bsd PR: 265276 Reported by: grahamperrin@ documentation/content/en/books/design-44bsd/_index.adoc | 1 + documentation/content/en/books/dev-model/_index.adoc | 1 + documentation/content/en/books/faq/_index.adoc | 1 + documentation/themes/beastie/layouts/books/single.html | 4 ---- 4 files changed, 3 insertions(+), 4 deletions(-)
Fixed! Thanks for the patch!
Thanks :-)