Skip to content

Commit 239f0eb

Browse files
committed
fix: fix images by disabled ideal-image
Also enable image zoom, which is the only reason I wanted ideal-image, which it turns out ideal image doesn't even do.
1 parent ef09cae commit 239f0eb

File tree

7 files changed

+44
-451
lines changed

7 files changed

+44
-451
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ yarn-debug.log*
3434
yarn-error.log*
3535

3636
# End of Docusaurus ignores
37+
38+
# Ignore Draw.io backups.
39+
*.bkp

docs/06-advanced-techniques/32-a-vim-crash-course/index.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ chapterNumber: 32
55
---
66

77
import CodeBlock from '@theme/CodeBlock';
8-
import Image from '@theme/IdealImage';
98
import AnnotatedCommand from '@site/src/components/AnnotatedCommmand/AnnotatedCommand.tsx';
109
import Caret from '@site/src/components/Caret/Caret.tsx';
1110

docs/zz-developer-guide/images-and-diagrams.mdx

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
title: Images and Diagrams
33
---
44

5-
import Image from '@theme/IdealImage';
65
import Drawio from '@theme/Drawio'
76

87
## Images
98

9+
:::info Not in Use
10+
11+
Ideal Image is not currently enabled as it appears to clash with native Docusaurus lazy-loading.
12+
13+
:::
14+
1015
The [`@docusaurus/plugin-ideal-image`](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-ideal-image) is used to allow lazy loading and zoom of images.
1116

1217
Use the `Image` tag as shown:
@@ -18,7 +23,13 @@ import Image from '@theme/IdealImage';
1823

1924
This will render an image as shown below:
2025

26+
::: warn Currently Disabled
27+
28+
```
2129
<Image img={require('./images/vim-cheatsheet.png')} />
30+
```
31+
32+
:::
2233

2334
## Diagrams
2435

docusaurus.config.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,18 @@ const config = {
157157
{}
158158
],
159159
[
160-
require.resolve('@docusaurus/plugin-ideal-image'),
161-
{
162-
// Enable this plugin in dev so that we can test it.
163-
disableInDev: false,
164-
},
160+
require.resolve('plugin-image-zoom'),
161+
{}
165162
],
163+
// Ideal Image seems to clash with Docusaurus native lazy loading, causing
164+
// most images not to load. So disabling this for now.
165+
// [
166+
// require.resolve('@docusaurus/plugin-ideal-image'),
167+
// {
168+
// // Enable this plugin in dev so that we can test it.
169+
// disableInDev: false,
170+
// },
171+
// ],
166172
],
167173
};
168174

0 commit comments

Comments
 (0)