在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:tobiasahlin/infinite-jekyll开源软件地址:https://github.com/tobiasahlin/infinite-jekyll开源编程语言:JavaScript 80.7%开源软件介绍:Infinite JekyllInfinite scroll for Jekyll based blogs. See it in action at tobiasahlin.com/blog/. Getting StartedAdd the <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> In <script src="/js/infinite-jekyll.js"></script> Render posts, not linksHow fun is it to only see links? Open up <li><span>{{ post.date | date_to_string }}</span> » <a href="{{ post.url }}">{{ post.title }}</a></li> Remove everything within the <li>
<h2>{{ post.title }}</h2>
<p class="meta">{{ post.date | date_to_string }}</p>
<div class="post">
{{ post.content }}
</div>
</li> Limit the number of postsPer default, Jekyll will render all posts in your entire archive. For lazy loading to make sense, we need to set a limit. Open up
Change it to:
You can change Add the spinnerYou should see your 10 latest posts on the front page, but no infinite scroll yet. Infinite Jekyll will only try to lazy load posts if there's a spinner present. At the very end of <div class="infinite-spinner"></div>
And you're done. Happy scrolling! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论