vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.26k stars 2.14k forks source link

Custom vue button/<a> not showing in local search #4175

Closed NOIR-DexPrkr closed 2 months ago

NOIR-DexPrkr commented 2 months ago

Describe the bug

I would appreciate if i get a little help with this problem.

Reproduction

I created a custom button to use in my website:

<template>
  <div>
    <a :href="link" :target="target">
      <div id="popup">
        <p id="lol">
          {{ text }}
        </p>
        <img :src="image" alt="Descarga" />
        <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="50" height="50" viewBox="0 0 60 60">
          <g>
            <path
              d="M 1.2 20.1 L 16.2 25.4 C 16.3 25.4 16.4 25.6 16.5 25.7 C 16.5 25.8 16.5 26.0 16.4 26.1 L 6.9 35.6 L 13.7 42.4 L 23.2 32.9 C 23.2 32.9 23.4 32.8 23.5 32.8 C 23.6 32.8 23.5 32.8 23.6 32.8 C 23.7 32.8 23.9 32.9 23.9 33.1 L 29.2 48.1 L 48.5 0.8 L 1.2 20.1 Z M 31.2 21.5 L 28.9 21.5 L 28.9 24.5 L 26.3 24.5 L 20.9 17.9 L 20.9 24.5 L 18.4 24.5 L 18.4 13.7 L 20.5 13.7 L 25.9 20.3 L 25.9 13.7 L 31.1 13.7 C 32.1 13.7 32.9 13.9 33.6 14.2 C 34.3 14.5 34.8 15.0 35.2 15.6 C 35.6 16.2 35.8 16.9 35.8 17.7 C 35.8 18.5 35.6 19.2 35.2 19.8 C 34.8 20.4 34.3 20.8 33.5 21.1 L 35.9 24.6 L 33.2 24.6 L 31.1 21.6 Z M 31 15.8 L 29 15.8 L 29 19.6 L 31 19.6 C 31.8 19.6 32.3 19.4 32.7 19.1 C 33.1 18.8 33.3 18.3 33.3 17.7 C 33.3 17.1 33.1 16.6 32.7 16.3 C 32.3 16.0 31.7 15.8 31.0 15.8 Z" />
          </g>
        </svg>
      </div>
    </a>
  </div>
</template>

I use it like this in my .md files

<NrClick link="https://play.google.com/store/apps/details?id=com.trianguloy.openInWhatsapp&hl=en&gl=US" text="Click to Chat" />

Expected behavior

Use local search and get the result of "Click to Chat"

But i got nothing.

System Info

Using docs:dev server

Additional context

Is there a way to solve this? I tried pagefind and flexsearch, but i like the local search function that shows the actual content of the page in detailed view.

Is this a bug or am i missing any option?

Thanks

Validations

brc-dd commented 2 months ago

Local search only scans markdown content. It doesn't consider the SSR'd stuff. Use some other search plugin that runs indexing after build.

Is this a bug or am i missing any option?

It's a design limitation.