Optimized website
Server-side rendering for syntax highlighting and DOM tree optimizations.
This commit is contained in:
@ -4,6 +4,5 @@
|
||||
</footer>
|
||||
</main>
|
||||
</div>
|
||||
<script src="prism.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -30,28 +30,8 @@
|
||||
})
|
||||
}
|
||||
function loader() {
|
||||
clipboard();
|
||||
exampleMaker();
|
||||
registerClickListener();
|
||||
}
|
||||
function clipboard() {
|
||||
// const snippets = document.querySelectorAll(":not(label) + pre");
|
||||
// snippets.forEach(snippet => {
|
||||
// const button = document.createElement("button");
|
||||
// button.className = 'primary clipboard-copy';
|
||||
// button.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clipboard"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg> Copy to clipboard';
|
||||
// snippet.parentElement.appendChild(button);
|
||||
// });
|
||||
}
|
||||
function exampleMaker() {
|
||||
// const examples = document.querySelectorAll("pre + pre");
|
||||
// examples.forEach(el => {
|
||||
// let label = document.createElement('label');
|
||||
// label.className = 'collapse';
|
||||
// label.innerHTML = 'Show examples';
|
||||
// el.parentNode.insertBefore(label, el);
|
||||
// });
|
||||
}
|
||||
function registerClickListener() {
|
||||
document.addEventListener('click', function (event) {
|
||||
if ( event.target.classList.contains('collapse') ) {
|
||||
|
||||
Reference in New Issue
Block a user