Code Monkey home page Code Monkey logo

Comments (6)

bglw avatar bglw commented on June 17, 2024 1

Hello! 👋

Hmm yes I see. It is intentional that data-pagefind-ignore only affects the indexing — for example the <head> is an implicit data-pagefind-ignore, but we still want to pluck filters and metadata out of it. In another case, I have sites where I wrap a sidebar navigation in data-pagefind-ignore, but some data inside that sidebar is useful for setting up a filter group.

I might look at expanding that attribute to take an argument. Then the current argumentless version would imply data-pagefind-ignore="index", and we could add a data-pagefind-ignore="all" which also omits filters and metadata.

How does that sound to you?

from pagefind.

vanbroup avatar vanbroup commented on June 17, 2024

That would work, thanks.

from pagefind.

vanbroup avatar vanbroup commented on June 17, 2024

Another thought here is that you can fall back to the open graph image when the content search has not provided any results, I don't think that this is something that can currently be configured.

from pagefind.

bglw avatar bglw commented on June 17, 2024

Yes good call. If you're defining your own data-pagefind-meta then subsequent definitions will overwrite the earlier ones, but there isn't a configuration to have the auto-detected image take precedence.

One way to allow this would be adding some configuration to the Pagefind UI along the lines of

{
  image: ["image", "og-image"]
}

Where the UI tries to use those keys in order for the image. Which would let the default image stay as meta.image, and you could separately tag your open graph image as og-image. Then at the UI end it can fall back to the og-image if no auto image was found.

from pagefind.

vanbroup avatar vanbroup commented on June 17, 2024

That could be a good approach, this meta data would also need to be ignored in the skipMeta in that case.

from pagefind.

bglw avatar bglw commented on June 17, 2024

Hi @vanbroup 👋

Some fixes have landed in Pagefind v0.5.0 🎉

  • data-pagefind-ignore="all" has been implemented as described above
  • An alternate solution for fallback content was implemented, allowing you to tag your og image as data-pagefind-default-meta

from pagefind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.