Skip to content

Commit

Permalink
feat: add plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
GabsEdits committed Jun 16, 2024
1 parent e0c4a8a commit 68c3476
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 5 deletions.
11 changes: 10 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { defineConfig } from "vitepress";
import { imgMark} from "@mdit/plugin-img-mark";
import { figure } from "@mdit/plugin-figure";

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

copyleft: {
show: true,
license: "GPL-3.0 license",
license: "GPL-3.0 License",
info: "https://www.gnu.org/licenses/gpl-3.0.html",
},

Expand All @@ -35,6 +37,13 @@ export default defineConfig({
},
},

markdown: {
config: (md) => {
md.use(imgMark);
md.use(figure);
},
},

head: [
["meta", { name: "author", content: "Gabriel Cozma" }],
["link", { rel: "icon", href: "/icon.png" }],
Expand Down
13 changes: 13 additions & 0 deletions docs/.vitepress/theme/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,16 @@ aside {
margin-bottom: 0;
}
}


@media (prefers-color-scheme: light) {
img[data-mode="darkmode-only"] {
display: none !important;
}
}

@media (prefers-color-scheme: dark) {
img[data-mode="lightmode-only"] {
display: none !important;
}
}
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ _Semantic HTML is the use of HTML markup to reinforce the semantics, or meaning,
## Why is it important?

<aside>
<picture>
<source srcset="/sh-exemple-dark.svg" media="(prefers-color-scheme:dark)">
<img src="/sh-exemple-light.svg" alt="A diagram of a basic website structure using semantic HTML elements">
</picture>

![A diagram of a basic website structure using semantic HTML elements](sh-exemple-light.svg#light)
![A diagram of a basic website structure using semantic HTML elements](sh-exemple-dark.svg#dark)

<figcaption>A diagram of a basic website structure using semantic HTML elements</figcaption>
</aside>

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"format": "prettier --write ."
},
"dependencies": {
"@mdit/plugin-figure": "^0.12.0",
"@mdit/plugin-img-mark": "^0.12.0",
"aplos": "2.1.0",
"prettier": "^3.3.2"
},
Expand Down
32 changes: 32 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 68c3476

Please sign in to comment.