Skip to content

Commit 68c3476

Browse files
committed
feat: add plugins
1 parent e0c4a8a commit 68c3476

File tree

5 files changed

+61
-5
lines changed

5 files changed

+61
-5
lines changed

docs/.vitepress/config.mts

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { defineConfig } from "vitepress";
2+
import { imgMark} from "@mdit/plugin-img-mark";
3+
import { figure } from "@mdit/plugin-figure";
24

35
// https://vitepress.dev/reference/site-config
46
export default defineConfig({
@@ -24,7 +26,7 @@ export default defineConfig({
2426

2527
copyleft: {
2628
show: true,
27-
license: "GPL-3.0 license",
29+
license: "GPL-3.0 License",
2830
info: "https://www.gnu.org/licenses/gpl-3.0.html",
2931
},
3032

@@ -35,6 +37,13 @@ export default defineConfig({
3537
},
3638
},
3739

40+
markdown: {
41+
config: (md) => {
42+
md.use(imgMark);
43+
md.use(figure);
44+
},
45+
},
46+
3847
head: [
3948
["meta", { name: "author", content: "Gabriel Cozma" }],
4049
["link", { rel: "icon", href: "/icon.png" }],

docs/.vitepress/theme/custom.scss

+13
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,16 @@ aside {
7474
margin-bottom: 0;
7575
}
7676
}
77+
78+
79+
@media (prefers-color-scheme: light) {
80+
img[data-mode="darkmode-only"] {
81+
display: none !important;
82+
}
83+
}
84+
85+
@media (prefers-color-scheme: dark) {
86+
img[data-mode="lightmode-only"] {
87+
display: none !important;
88+
}
89+
}

docs/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ _Semantic HTML is the use of HTML markup to reinforce the semantics, or meaning,
77
## Why is it important?
88

99
<aside>
10-
<picture>
11-
<source srcset="/sh-exemple-dark.svg" media="(prefers-color-scheme:dark)">
12-
<img src="/sh-exemple-light.svg" alt="A diagram of a basic website structure using semantic HTML elements">
13-
</picture>
10+
11+
![A diagram of a basic website structure using semantic HTML elements](sh-exemple-light.svg#light)
12+
![A diagram of a basic website structure using semantic HTML elements](sh-exemple-dark.svg#dark)
13+
1414
<figcaption>A diagram of a basic website structure using semantic HTML elements</figcaption>
1515
</aside>
1616

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"format": "prettier --write ."
77
},
88
"dependencies": {
9+
"@mdit/plugin-figure": "^0.12.0",
10+
"@mdit/plugin-img-mark": "^0.12.0",
911
"aplos": "2.1.0",
1012
"prettier": "^3.3.2"
1113
},

pnpm-lock.yaml

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)