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

Use IntersectionObserver to lazyload comments #1305

Merged
merged 2 commits into from
Dec 9, 2019
Merged

Conversation

jiangtj
Copy link
Member

@jiangtj jiangtj commented Dec 9, 2019

PR Checklist

  • The commit message follows our guidelines.
  • Tests for the changes was maked (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs in NexT website have been added / updated (for features).

PR Type

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes.
  • No.

@jiangtj jiangtj added this to the v7.7.0 milestone Dec 9, 2019
Copy link
Contributor

@stevenjoezhang stevenjoezhang left a comment

Choose a reason for hiding this comment

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

LGTM!

@jiangtj jiangtj merged commit 34ffcee into master Dec 9, 2019
@jiangtj jiangtj deleted the lazyload-comments branch December 9, 2019 07:45
@stevenjoezhang
Copy link
Contributor

#1152 (comment)

@jiangtj
Copy link
Member Author

jiangtj commented Dec 12, 2019

https://github.com/theme-next/hexo-next-utteranc/blob/6f841a67c9d12f1453be8269abb6307862542753/index.js#L21 It only has a <script>. Although it can be changed, it is a bit annoying. Anyway, just lazy loading doesn't work, no other effect.

GitHub
Utteranc comment system for NexT. Contribute to theme-next/hexo-next-utteranc development by creating an account on GitHub.

NexT.utils.getScript('{{ valine_uri }}', () => {
var GUEST = ['nick', 'mail', 'link'];
var guest = '{{ theme.valine.guest_info }}';
guest = guest.split(',').filter(item => {
return GUEST.includes(item);
});
new Valine({
el: '#comments',
el: '#valine-comments',
Copy link
Collaborator

Choose a reason for hiding this comment

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

this makes the hyperlink doesn't working.

<a title="valine" href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">

sli1989 added a commit to sli1989/hexo-theme-next that referenced this pull request Jan 14, 2020
stevenjoezhang pushed a commit that referenced this pull request Jan 22, 2020
@sli1989
Copy link
Collaborator

sli1989 commented Mar 23, 2020

有没有可能都变成 id="comments" 这样的超链接。不同评论不同跳转tag感觉也不是很好。

stevenjoezhang referenced this pull request in next-theme/hexo-theme-next Jul 23, 2020
voidking pushed a commit to voidking/hexo-theme-next-2021 that referenced this pull request Oct 28, 2020
voidking pushed a commit to voidking/hexo-theme-next-2021 that referenced this pull request Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants