Skip to content
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

Don't include "home file" in documentation search #4243

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .release-notes/docgen-search-home-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Don't include generated documentation "home file" in search index

We've updated the documentation generation to not include the "home file" that lists the packages in the search index. The "exclude from search engine" functionality is only available in the `mkdocs-material-insiders` theme.

The home file is extra noise in the index that provides no value. For anyone using the insiders theme, this will be an improvement in the search experience.
5 changes: 5 additions & 0 deletions src/libponyc/pass/docgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,11 @@ void generate_docs(ast_t* program, pass_opt_t* options)
const char* name = package_filename(package);

fprintf(docgen.home_file, "Packages\n\n");
// tell the mkdocs theme not index the home file for search
fprintf(docgen.home_file, "---\n");
fprintf(docgen.home_file, "search:\n");
fprintf(docgen.home_file, " exclude: true\n");
fprintf(docgen.home_file, "---\n");

fprintf(docgen.index_file, "site_name: %s\n", name);
fprintf(docgen.index_file, "theme:\n");
Expand Down