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
|
@ -18,6 +18,7 @@
|
|||
"@docusaurus/mdx-loader": "^2.0.0-alpha.58",
|
||||
"@docusaurus/types": "^2.0.0-alpha.58",
|
||||
"@docusaurus/utils": "^2.0.0-alpha.58",
|
||||
"@docusaurus/core": "2.0.0-alpha.58",
|
||||
"@hapi/joi": "^17.1.1",
|
||||
"feed": "^4.1.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
|
@ -28,7 +29,6 @@
|
|||
"remark-admonitions": "^1.2.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@docusaurus/core": "^2.0.0",
|
||||
"react": "^16.8.4",
|
||||
"react-dom": "^16.8.4"
|
||||
},
|
||||
|
|
|
@ -10,6 +10,7 @@ import kebabCase from 'lodash.kebabcase';
|
|||
import path from 'path';
|
||||
import admonitions from 'remark-admonitions';
|
||||
import {normalizeUrl, docuHash, aliasedSitePath} from '@docusaurus/utils';
|
||||
import {STATIC_DIR_NAME} from '@docusaurus/core/lib/constants';
|
||||
import {ValidationError} from '@hapi/joi';
|
||||
|
||||
import {
|
||||
|
@ -363,6 +364,7 @@ export default function pluginContentBlog(
|
|||
options: {
|
||||
remarkPlugins,
|
||||
rehypePlugins,
|
||||
staticDir: path.join(siteDir, STATIC_DIR_NAME),
|
||||
// Note that metadataPath must be the same/in-sync as
|
||||
// the path from createData for each MDX.
|
||||
metadataPath: (mdxPath: string) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue