web/assets/js/_src/toc.js

14 lines
319 B
JavaScript
Raw Normal View History

/*
* Hide the empty ToC in posts.
2020-01-02 16:17:49 +03:00
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2019 Cotes Chung
* MIT Licensed
*/
$(function() {
if ($("#post-wrapper .post-content h1").length == 0
&& $("#post-wrapper .post-content h2").length == 0) {
$("#toc-wrapper").addClass("unloaded");
}
});