sukr
sukr is the website generator that powers this website. It's a pure rust, mermaid & LaTeX enable, HTML & CSS only static website generator.
As is it works great, I've done a few tweaks, listed here.
Add a styling for blockquotesΒΆ
By default, sukr doesn't indent blockquotes, do add this functionnality, simply add add the following to your style.css:
blockquote {
border-left: 1px solid var(--border);
padding-left: 1rem;
}
Add a copy to clipboard button for codeΒΆ
Kudos to the creator of sukr that provided the following solution
Add the following just before the </body> tag in base.html.
<script>
document.querySelectorAll('pre > code').forEach(block => {
const btn = document.createElement('button');
btn.className = 'copy-btn';
btn.textContent = 'π';
btn.addEventListener('click', () => {
navigator.clipboard.writeText(block.textContent);
btn.textContent = 'β';
setTimeout(() => btn.textContent = 'π', 1500);
});
block.parentElement.style.position = 'relative';
block.parentElement.appendChild(btn);
});
</script>
And a bit of CSS in your style.css:
.copy-btn {
position: absolute;
top: 0.5rem;
right: 0.5rem;
background: var(--bg-sidebar);
border: 1px solid var(--border);
color: var(--fg-muted);
cursor: pointer;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.85rem;
opacity: 0;
transition: opacity 0.2s;
}
pre:hover .copy-btn { opacity: 1; }