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

TOC scroll chasing failed on the homepage if 'disqus' is set. #730

Closed
jfcherng opened this issue Mar 8, 2018 · 3 comments
Closed

TOC scroll chasing failed on the homepage if 'disqus' is set. #730

jfcherng opened this issue Mar 8, 2018 · 3 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@jfcherng
Copy link
Contributor

jfcherng commented Mar 8, 2018

Description

My disqus is set in the yaml config like

extra:
  disqus: 'my_disqus_id'

The homepage is hard-coded to not show the Disqus forum.

{% if (config.extra.disqus and not page.is_homepage) or
(page and page.meta and page.meta.disqus) %}
{% include "partials/integrations/disqus.html" %}
{% endif %}

However, in the homepage, if disqus is set, there would be a Comment section in TOC.

After scrolling down and up in the homepage, my Chrome console shows

application.8eb9be28.js:1 Uncaught TypeError: Cannot read property 'offsetTop' of undefined
    at e.update (application.8eb9be28.js:1)
    at update_ (application.8eb9be28.js:1)

and then the TOC scroll chasing failed.

Expected behavior

The Comment section should not be shown in homepage's TOC.

Actual behavior

It shows.

Steps to reproduce the bug

  1. Set any disqus id in the yaml config
  2. Build the site

Package versions

  • Python: Python 3.6.4
  • MkDocs: mkdocs, version 0.17.2
  • Material: Version: 2.7.0
@squidfunk
Copy link
Owner

Thanks, that's indeed a bug.

@squidfunk squidfunk added the bug Issue reports a bug label Mar 8, 2018
@squidfunk
Copy link
Owner

Fixed in 6ecf71e

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Mar 21, 2018
@squidfunk
Copy link
Owner

Fix released as part of 2.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants