Open trevor-coleman opened 6 months ago
projects place their images in their static folder. These will be copied into ~/static/<project-name>
static
~/static/<project-name>
~ ├── src │ └── ... └── docs └── static ├── img │ ├── project-logo.png │ ├── project-banner@2x.jpg │ └── ... └── ...
the path of the image file is added as a prop to customProps in the _category_.json
customProps
_category_.json
// ~/docs/_category_.json (in project) { "customProps": { "card": "img/project-logo.png" "banner": "img/project-banner@2x.jpg" // ... } // ... }
the custom-homepage-plugin (A.K.A. /plugins/homepage-items-plugin.js😬) reads the paths fromcategory.jsonand adapts them to their-docs` directory structure.
custom-homepage-plugin
😬) reads the paths from
and adapts them to the
'img/project-logo.png' => `/${projectName}/img/project-logo.png`
Components consume this via the docusaurus context.
Summary
Things to decide
Technical Implementation
projects place their images in their
static
folder. These will be copied into~/static/<project-name>
the path of the image file is added as a prop to
customProps
in the_category_.json
the
custom-homepage-plugin
(A.K.A. /plugins/homepage-items-plugin.js😬) reads the paths from
category.jsonand adapts them to the
ir-docs` directory structure.Components consume this via the docusaurus context.