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

fix search engine optimization and find in page experience for information in accordians #1656

Open
bdb-dd opened this issue May 29, 2024 · 3 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@bdb-dd
Copy link
Contributor

bdb-dd commented May 29, 2024

Description

Several of our articles use accordian components to hide certain content by default. The standard way of implementing this has been to set the css property display: none. An unfortunate side effect of this, however, is that the hidden content is unavailable when using the in-page search function in the browser.

This article describes how to use an alternative approach that fixes this issue.

In particular, our Common deps page would be improved by implementing this change. Some work may be needed to deal with the caveats listed.

This new css feature is not yet supported by all browsers, but a backwards compatible implementation is possible.

https://caniuse.com/?search=until-found

@bdb-dd bdb-dd added the kind/feature-request New feature or request label May 29, 2024
@bdb-dd bdb-dd changed the title improve search experience in articles with multiple accordians fix search engine optimization and find in page experience for information in accordians Jun 4, 2024
@bdb-dd
Copy link
Contributor Author

bdb-dd commented Jun 4, 2024

Note: it appears that this issue is not limited to the "find in page" functionality of the browser. Having run into this behaviour while investigating "holes" in the training dataset for Altinn Assistant, I can now confirm that this issue also affects the ability for external crawlers to index the Accordian content.

Here is an example search that should return the following page, under gridProps:
https://docs.altinn.studio/app/development/ux/components/commondefs/

@bdb-dd
Copy link
Contributor Author

bdb-dd commented Jun 4, 2024

A candidate fix is available for testing here.

Further work should be done to better support toggling on browsers lacking support for the hidden="until-found"attribute value.

@bdb-dd bdb-dd added kind/bug Something isn't working and removed kind/feature-request New feature or request labels Jun 4, 2024
@bdb-dd
Copy link
Contributor Author

bdb-dd commented Jun 5, 2024

Further analysis has shown that the SEO problems are probably not related to the accordian and I have been able to isolate the challenge for the Assistant crawler to differences in HTML structure, rather than accordians in general. Main issue text updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant