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 active grandchild link class #962

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

pdmosses
Copy link
Contributor

An occurrence of grandchild was miss-spelled grand_child (!). That caused omission of the active class in the link in the nav panel for all grandchildren (affecting only the boldness of the displayed links).

This bug was discovered using diff to compare just-the-docs/just-the-docs-tests sites built using v0.4.0.rc1 and commit 4396b6b on the fix-nav-performance PR branch.

The bug is also evident in the nav panel at https://just-the-docs.github.io/just-the-docs/docs/ui-components/code/line-numbers/, which was built after pre-release v0.4.0.rc2.

A simple test of this PR is to compare the above nav panel link for Code with line numbers (when that page is selected) with the corresponding link in the preview of this PR.

@pdmosses
Copy link
Contributor Author

I used the following command to compare built sites:

diff -r -x search-data.json -I "<meta\|BlogPosting" _site-0.4.0.rc1-3.8.7 _site-fix-nav-performance-3.8.7 > diff-r.txt

The -I option ignores lines that contain <meta or BlogPosting, which depend on the build time.

But I don't understand why jekyll-seo-tag uses "@type":"BlogPosting" for some of the test site pages, and"@type":"WebPage" for others…

An occurrence of `grandchild` was miss-spelled `grand_child` (!).
That caused omission of the `active` class in the link in the nav panel for all grandchildren.

This bug was discovered using `diff` to compare the generated sites built using v0.4.0.rc1 and commit  4396b6b on the fix-nav-performance PR branch.
@pdmosses pdmosses force-pushed the fix-active-grandchild-class branch from 3cce2ac to 131cd28 Compare September 15, 2022 16:56
@pdmosses
Copy link
Contributor Author

pdmosses commented Sep 15, 2022

The diff command that I used was:

diff -r -x search-data.json -I "<meta\|BlogPosting" _site-0.4.0.rc1-3.8.7 _site-fix-nav-performance-3.8.7 > diff-r.txt

The output was: diff-r.txt. It indicates that the omission of active on grandchild pages is the only significant difference between the html pages in v0.4.0.rc1 and the site built using the commit for the fix-nav-performance PR branch.

Does anyone know why jekyll-seo-tag regards the LD-JSON @type of some ordinary pages (in collections on just-the-docs-tests) as BlogPosting instead of WebPage? It seems very misleading!

@pdmosses pdmosses requested a review from mattxwang September 15, 2022 17:27
Copy link
Member

@mattxwang mattxwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround @pdmosses, I didn't catch this error earlier.

Unfortunately, not familiar with jekyll-seo-tag to answer your question on meta-related shenanigans. Do you think this is appropriate to raise an issue upstream?

@mattxwang mattxwang merged commit b3e3eaf into just-the-docs:main Sep 15, 2022
@mattxwang
Copy link
Member

Changelog:

@pdmosses
Copy link
Contributor Author

Unfortunately, not familiar with jekyll-seo-tag to answer your question on meta-related shenanigans. Do you think this is appropriate to raise an issue upstream?

After the release of v0.4.0, I'll take a closer look. Perhaps somebody in our user community knows the answer, so I might raise it as a local issue. I've no idea whether the jekyll-seo-tag maintainers are at all interested in such issues – they write:

Jekyll SEO tag isn't designed to accommodate every possible use case. It should work for most site out of the box…

@pdmosses pdmosses deleted the fix-active-grandchild-class branch September 22, 2022 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants