mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 06:47:49 +00:00
Let gutenberg generate the table of contents
Remove the javascript toc code.
This commit is contained in:
@@ -2,22 +2,6 @@ window.onload = function() {
|
||||
var container = document.querySelector('#toc');
|
||||
|
||||
if (container != null) {
|
||||
var toc = initTOC({
|
||||
selector: 'h2, h3',
|
||||
scope: 'main',
|
||||
overwrite: false,
|
||||
prefix: 'toc'
|
||||
});
|
||||
|
||||
toc.innerHTML = toc.innerHTML.split("🔗\n").join("");
|
||||
|
||||
var heading = document.createElement("H2");
|
||||
var heading_text = document.createTextNode("Table of Contents");
|
||||
heading.appendChild(heading_text);
|
||||
|
||||
container.appendChild(heading);
|
||||
container.appendChild(toc);
|
||||
|
||||
resize_toc(container);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user