From c9126a4a66eff0e6fd2c8b5b71a158f9a648faa2 Mon Sep 17 00:00:00 2001 From: anshul Date: Tue, 4 Aug 2020 01:01:24 +0530 Subject: [PATCH 1/3] fix loader --- packages/docusaurus/src/webpack/utils.ts | 2 +- website/docs/markdown-features.mdx | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus/src/webpack/utils.ts b/packages/docusaurus/src/webpack/utils.ts index 155a2f613426..659107bbfe20 100644 --- a/packages/docusaurus/src/webpack/utils.ts +++ b/packages/docusaurus/src/webpack/utils.ts @@ -220,7 +220,7 @@ export function getFileLoaderUtils() { images: (): RuleSetRule => { return { use: [loaders.url({folder: 'images'})], - test: /\.(ico|svg|jpg|jpeg|png|gif|webp)(\?.*)?$/, + test: /\.(ico|jpg|jpeg|png|gif|webp)(\?.*)?$/, }; }, diff --git a/website/docs/markdown-features.mdx b/website/docs/markdown-features.mdx index 4945c46166ef..f6d7425ee3dc 100644 --- a/website/docs/markdown-features.mdx +++ b/website/docs/markdown-features.mdx @@ -1043,4 +1043,19 @@ or [![](./assets/docusaurus-asset-example-banner.png)](./assets/docusaurus-asset-example-pdf.pdf) ``` -[![](./assets/docusaurus-asset-example-banner.png)](./assets/docusaurus-asset-example-pdf.pdf) \ No newline at end of file +[![](./assets/docusaurus-asset-example-banner.png)](./assets/docusaurus-asset-example-pdf.pdf) + +### Inline SVGs + +Docusaurus support inlining SVGs out of the box. + +```js + +import SVG from "../static/img/docusaurus.svg" + + + +``` +import SVG from "../static/img/docusaurus.svg" + + \ No newline at end of file From 39af21419d1ed27f782dfb98b979ef6bff7edffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Wed, 5 Aug 2020 19:00:42 +0200 Subject: [PATCH 2/3] Update website/docs/markdown-features.mdx --- website/docs/markdown-features.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/markdown-features.mdx b/website/docs/markdown-features.mdx index f6d7425ee3dc..2899dd6feb76 100644 --- a/website/docs/markdown-features.mdx +++ b/website/docs/markdown-features.mdx @@ -1051,11 +1051,11 @@ Docusaurus support inlining SVGs out of the box. ```js -import SVG from "../static/img/docusaurus.svg" +import DocusaurusSvg from "./docusaurus.svg" - + ``` import SVG from "../static/img/docusaurus.svg" - \ No newline at end of file + From 87a566a27ebc399c1e4b36c83bdd8f86e869f99a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Wed, 5 Aug 2020 19:01:58 +0200 Subject: [PATCH 3/3] Update website/docs/markdown-features.mdx --- website/docs/markdown-features.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/markdown-features.mdx b/website/docs/markdown-features.mdx index 2899dd6feb76..ded44546b29a 100644 --- a/website/docs/markdown-features.mdx +++ b/website/docs/markdown-features.mdx @@ -1056,6 +1056,6 @@ import DocusaurusSvg from "./docusaurus.svg" ``` -import SVG from "../static/img/docusaurus.svg" +import DocusaurusSvg from "@site/static/img/docusaurus.svg" - +