Skip to content

Nesting rankings (data-pagefind-weight) #1197

@kslstn

Description

@kslstn

I tried assigning a data-pagefind-weight to whole layouts, to make content with specific layouts rank higher. In my limited testing, this doesn't seem to work, possibly due to nested data-pagefind-weight and data-pagefind-body attributes.

I couldn't find in the docs on weighting if nested weighting attributes are ignored, multiplied or even allowed to begin with.

I've got several questions that I'd be happy to address via a PR to the docs, if I knew the answers.

<body data-pagefind-weight="5">
  <article data-pagefind-body>
    <h1>Title</h1>
    <p  data-pagefind-weight="1">Paragraph</p>
  </article>
</body>
  1. Does <h1> have weight 5 or the default for <h1> of 7?
  2. Does <p> have weight 5 * 1 = 5, 1 (which is set on the tag) or 5 (inherited from <body>)?
  3. Should the outcomes be different if data-pagefind-weight="5" is applied to <body>? (Is it even considered if it appears outside a tag with a data-pagefind-body?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions