web/assets/js/_src/toc.js

13 lines
251 B
JavaScript
Raw Normal View History

/*
* Hide the empty ToC in posts.
*
* © 2019 Cotes Chung
* MIT Licensed
*/
$(function() {
2019-11-24 19:19:03 +03:00
if ($("#post-wrap .post-content h1").length == 0
&& $("#post-wrap .post-content h2").length == 0) {
2019-11-24 19:19:03 +03:00
$("#toc-wrap").addClass("hidden");
}
});