-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: remove reusable content from search result #516
docs: remove reusable content from search result #516
Conversation
This looks like it prevents it surfacing in search, but it's still accessible as a page: https://canonical-pebble--516.com.readthedocs.build/en/516/reuse/service-start-order/ Can we prevent that? |
Resolved it once and for all :) 404 for |
That looks better, thanks. I don't mind the renaming if that's the only way to do that. But is there a way to say "don't add pages for anything under the 'reuse' directory?" Because these files are actually Markdown, right, so we're now kind of lying about the file extension. Would it work to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this looks like the right approach and much simpler to me, thanks.
Technically they are not markdown but rst, and in the starter pack there is already a With the previous change on reusable content and terminal output format for CLI command references, many "*.md" (like But I do agree that excluding the reuse directory in the custom_excludes is much better, because no matter what file extensions we might have in the reuse directory in the future, it's guaranteed to be ignored. See the latest commit. |
Remove reusable content pages by excluding the
reuse
directory.Currently, if we search certain keywords in the reusable content, the reusable content pages themselves also show up in the search result. This is because they are rendered as real pages. This PR fixes that by ignoring all pages under the
reuse
directory.We have considered two other options:
nosearch: true
keyword to the reusable content pages so they are not searchable, but they are still rendered as doc pages and if you know the URL you can still access them.link.txt
reusable page, but it's actually "lying" since the file isn't a txt but rst. And, if we accidentally added some other files into the reuse folder in the future, like a new markdown or rst file, it's still not ignored, so we preferred the custom_excludes method in this PR.Preview here.