-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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.
|
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', |
There was a problem hiding this comment.
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"> |
有没有可能都变成 |
PR Checklist
PR Type
What is the new behavior?
Does this PR introduce a breaking change?