cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
438 stars 67 forks source link

Add markup to templates #6

Closed loque closed 4 years ago

loque commented 4 years ago

Hey, awesome plugin! I made a few modifications to make it easier to style the suggestions:

The resulting markup would look something like this:

<span class="aa-dropdown-menu aa-with-1">
  <div class="aa-dataset-1">
    <span class="aa-suggestions">
      <div class="aa-suggestion">
        <span class="aa-suggestion-section">Hello</span>
      </div>
      <div class="aa-suggestion">
        <span class="aa-suggestion-page">BLOG POST TITLE</span>
        <span class="aa-suggestion-section">FIRST HEADER</span>
      </div>
      <!-- more suggestions.. -->
    </span>
  </div>
  <span class="aa-suggestion-empty"></span>
</span>

Rendering something like this: imagen

And rendering this when no results are found: imagen

cmfcmf commented 4 years ago

Looks really good, thank you! There is only one thing I am not sure about: Currently, when section and page have the same title, you apply the aa-suggestion-section class and no aa-suggestion-page class. I'd like to see this reversed, i.e. always render the page title and aa-suggestion-page class and render the section title and aa-suggestion-section class when the section title is different from the page title. Would you be able to change that around? :100:

loque commented 4 years ago

Right! Makes more sense 🤦‍♂️. I'll fix that now.