mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
feat(v2): support for adding relative images and handling broken image links (#3069)
* all relative path in image url * throw error if file doesn't present * better error * add @docusaurus/core to deps * fix test
This commit is contained in:
parent
15e73daae7
commit
3155dc30dc
15 changed files with 162 additions and 4 deletions
|
@ -33,10 +33,10 @@
|
|||
"lodash.pickby": "^4.6.0",
|
||||
"lodash.sortby": "^4.6.0",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"shelljs": "^0.8.4"
|
||||
"shelljs": "^0.8.4",
|
||||
"@docusaurus/core": "^2.0.0-alpha.58"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "^2.0.0",
|
||||
"react": "^16.8.4",
|
||||
"react-dom": "^16.8.4"
|
||||
},
|
||||
|
|
|
@ -13,6 +13,7 @@ import globby from 'globby';
|
|||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import admonitions from 'remark-admonitions';
|
||||
import {STATIC_DIR_NAME} from '@docusaurus/core/lib/constants';
|
||||
import {
|
||||
normalizeUrl,
|
||||
docuHash,
|
||||
|
@ -524,6 +525,7 @@ Available document ids=
|
|||
options: {
|
||||
remarkPlugins,
|
||||
rehypePlugins,
|
||||
staticDir: path.join(siteDir, STATIC_DIR_NAME),
|
||||
metadataPath: (mdxPath: string) => {
|
||||
// Note that metadataPath must be the same/in-sync as
|
||||
// the path from createData for each MDX.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue