Skip to content

Commit 741af0f

Browse files
authored
feat: use docusaurus-plugin-image-zoom to add zoomable images (#1689)
Utilizes `docusaurus-plugin-image-zoom` to add a simple zoom feature on all post images.
1 parent 5f0e49b commit 741af0f

File tree

4 files changed

+77
-2
lines changed

4 files changed

+77
-2
lines changed

apify-docs-theme/src/theme/custom.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ div[class*="searchBox"] {
957957
.menu__link.icon::before {
958958
display: none;
959959
}
960-
960+
961961
.navbar__inner .navbar__item.navbar__link.icon {
962962
display: none;
963963
}
@@ -1980,3 +1980,7 @@ div[class^="navbarSearchContainer"] {
19801980
position: static;
19811981
}
19821982
}
1983+
1984+
.medium-zoom-image--opened {
1985+
z-index: 999;
1986+
}

docusaurus.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ module.exports = {
127127
],
128128
]),
129129
plugins: [
130+
'docusaurus-plugin-image-zoom',
130131
[
131132
'@docusaurus/plugin-content-docs',
132133
{
@@ -307,6 +308,9 @@ module.exports = {
307308
'http', 'bash', 'ruby', 'java', 'scala', 'go', 'csharp', 'powershell', 'dart', 'objectivec', 'ocaml', 'r',
308309
],
309310
},
311+
zoom: {
312+
selector: '.markdown img:not(a img)',
313+
},
310314
languageTabs: [
311315
{
312316
highlight: 'bash',

package-lock.json

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
"globby": "^14.0.0",
6060
"markdownlint": "^0.38.0",
6161
"markdownlint-cli": "^0.45.0",
62-
"path-browserify": "^1.0.1",
6362
"patch-package": "^8.0.0",
63+
"path-browserify": "^1.0.1",
6464
"rimraf": "^6.0.0",
6565
"typescript": "5.8.3",
6666
"typescript-eslint": "^8.29.1"
@@ -80,6 +80,7 @@
8080
"@redocly/cli": "^1.27.1",
8181
"ajv": "^8.17.1",
8282
"clsx": "^2.0.0",
83+
"docusaurus-plugin-image-zoom": "^3.0.1",
8384
"docusaurus-plugin-openapi-docs": "^4.3.7",
8485
"docusaurus-theme-openapi-docs": "^4.3.7",
8586
"form-data": "^4.0.0",

0 commit comments

Comments
 (0)