Skip to content

Commit c263872

Browse files
committed
fix: add .gif to raw imgur links
1 parent 840b302 commit c263872

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"//chalk@4": "also ESM related problem",
4545
"dependencies": {
4646
"@notionhq/client": "^1.0.4",
47-
"chalk": "^5.0.1",
47+
"chalk": "^4.1.2",
4848
"commander": "^9.2.0",
4949
"file-type": "16.5.1",
5050
"fs-extra": "^10.1.0",

src/DocusaurusTweaks.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,16 @@ function notionEmbedsToMDX(input: string): {
4040
import: `import ReactPlayer from "react-player";`,
4141
output: `<ReactPlayer controls url="$1" />`,
4242
};
43-
const gif = {
43+
/* GifPlayer worked with some sources but not imgur which is the most important for my project. It would just give CORS errors.
44+
And it is unmaintained. So let's just let the raw gif link do its thing.
45+
const gif = {
4446
import: `import GifPlayer from "react-gif-player";`,
4547
output: `<GifPlayer gif="$1" />`,
4648
};
49+
*/ const gif = {
50+
import: "",
51+
output: `![]($1.gif)`, // note: imgur links to gifs need a .gif at the end, but the url they give you doesn't have one.
52+
};
4753
const embeds = {
4854
youtube: {
4955
regex: /\[.*\]\((.*youtube\.com\/watch.*)\)/gm, //youtube.com/watch

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2447,7 +2447,7 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2:
24472447
ansi-styles "^4.1.0"
24482448
supports-color "^7.1.0"
24492449

2450-
chalk@^5.0.0, chalk@^5.0.1:
2450+
chalk@^5.0.0:
24512451
version "5.0.1"
24522452
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.0.1.tgz#ca57d71e82bb534a296df63bbacc4a1c22b2a4b6"
24532453
integrity sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==

0 commit comments

Comments
 (0)