diff --git a/.release-notes/docgen-search-home-file.md b/.release-notes/docgen-search-home-file.md new file mode 100644 index 0000000000..f644369e28 --- /dev/null +++ b/.release-notes/docgen-search-home-file.md @@ -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. diff --git a/src/libponyc/pass/docgen.c b/src/libponyc/pass/docgen.c index 0f8ec1f63f..0fb234c092 100644 --- a/src/libponyc/pass/docgen.c +++ b/src/libponyc/pass/docgen.c @@ -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");