Skip to content
Discussion options

You must be logged in to vote

The search plugin currently doesn't allow for that. As said, we're working on ground up rewrite which will yield much better search summaries and provide more compact results, but it's still going to take some time. However, you have two options:

  1. Hide the search result content with CSS. That way, the content will still be searchable, so keywords in the content of a page will still match that page. Something like:

    .md-search-result__article > :not(h1, h2, div) {
       display: none;
    }
  2. Remove the text attribute from all entries in search_index.json as a post-processing step in a custom hook. It's likely 4-5 lines of Python, but search will only match titles.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@aborruso
Comment options

@aborruso
Comment options

@squidfunk
Comment options

@aborruso
Comment options

Answer selected by aborruso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants