Skip to content

Commit

Permalink
plugins: make images zoom when clicked
Browse files Browse the repository at this point in the history
Use docusaurus-plugin-image-zoom plugin to make images zoomable when clicked.

Signed-off-by: Mike Szczys <[email protected]>
  • Loading branch information
szczys committed Jun 6, 2024
1 parent 4eca1b4 commit 485e5d2
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
12 changes: 11 additions & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const config = {
],
],

plugins: [ ],
plugins: [ 'docusaurus-plugin-image-zoom' ],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
Expand Down Expand Up @@ -150,6 +150,16 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
zoom: {
selector: '.markdown :not(em) > img',
config: {
// options you can specify via https://github.com/francoischalifour/medium-zoom#usage
background: {
light: 'rgb(255, 255, 255)',
dark: 'rgb(50, 50, 50)'
}
}
},
}),
}

Expand Down
60 changes: 60 additions & 0 deletions website/package-lock.json

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

1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@docusaurus/preset-classic": "^3.1.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.1.1",
"docusaurus-plugin-image-zoom": "^2.0.0",
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down

0 comments on commit 485e5d2

Please sign in to comment.