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

Comments

Projects
None yet
2 participants
@jfcherng

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

This comment has been minimized.

Owner

squidfunk commented Mar 8, 2018

Thanks, that's indeed a bug.

@squidfunk squidfunk added the bug label Mar 8, 2018

@squidfunk

This comment has been minimized.

Owner

squidfunk commented Mar 21, 2018

Fixed in 6ecf71e

@squidfunk

This comment has been minimized.

Owner

squidfunk commented Mar 21, 2018

Fix released as part of 2.7.1

@squidfunk squidfunk closed this Mar 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment