site: add code line numbers

This commit is contained in:
Glen Huang
2025-10-06 22:48:11 +08:00
committed by Johannes Kirschbauer
parent 11d851e934
commit 68afbb564e
2 changed files with 18 additions and 3 deletions

View File

@@ -9,7 +9,19 @@
{JSON.stringify(data.frontmatter)}
<style>
.toc :global(p) {
margin: 0;
:global {
.shiki code {
counter-reset: step;
counter-increment: step 0;
}
.line::before {
content: counter(step);
counter-increment: step;
width: 1rem;
margin-right: 1.5rem;
display: inline-block;
text-align: right;
color: rgba(115,138,148,.4);
}
}
</style>

View File

@@ -7,6 +7,9 @@ b: 2
```js
const abc = 1 + "2";
const abc = 1 + "2";
const abc = 1 + "2";
const abc = 1 + "2";
```
## Step Foo