Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] Simplify Algolia crawler config #41312

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Feb 28, 2024

See the last issue in https://groups.google.com/a/mui.com/g/docs-infra/c/81eISb5eXmA. Once MUI X sync with these changes, we should be able to simplify the crawler config:

        const result = helpers.docsearch({
          recordVersion: "v3",
          recordProps: {
            lvl0: {
              selectors: ".this-selector-will-never-match",
              defaultValue: $(".algolia-lvl0")
                .map((index, element) => $(element).text())
                .get()
                .join(" > "),
            },
            lvl1: [".algolia-lvl1", ".markdown-body h1"],
            lvl2: [".algolia-lvl2", ".markdown-body h2"],
            lvl3: [
              ".algolia-lvl3",
              ".markdown-body h3",
              ".markdown-body td:first-of-type",
            ],
            lvl4: [".algolia-lvl4", ".markdown-body h4"],
            content:
              ".algolia-content, .markdown-body p, .markdown-body li, .markdown-body td:last-of-type",
          },
        });

Part of the value is to be able to change the DOM structure without breaking the crawler, especially when spread between different deployment units (Base UI, Material UI, MUI X almost never using the same version of docs-infra at any moment in time)

@oliviertassinari oliviertassinari added enhancement This is not a bug, nor a new feature scope: docs-infra Specific to the docs-infra product labels Feb 28, 2024
@mui-bot
Copy link

mui-bot commented Feb 29, 2024

Netlify deploy preview

https://deploy-preview-41312--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 87f8c19

@oliviertassinari oliviertassinari changed the title [docs–infra] Simplify Algolia crawler config [docs-infra] Simplify Algolia crawler config Mar 1, 2024
@oliviertassinari oliviertassinari merged commit f1eacff into mui:master Mar 8, 2024
21 checks passed
@oliviertassinari oliviertassinari deleted the be-explicit branch March 8, 2024 00:40
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants