Add support for images -- logo/thumbnail for cards on home page. Banner for intro to docs.
Opened this issue · 0 comments
trevor-coleman commented
Summary
- Add image previews to cards to reinforce the project brand
Things to decide
- which image assets are needed from each project
- standard size would be best -- i.e card preview is 300x200, banner is 1600x900 or whatever
- standard / fallback assets for projects when preferred assets aren't available or are in the wrong place
Technical Implementation
-
projects place their images in their
static
folder. These will be copied into~/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
// ~/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 from
category.jsonand adapts them to the
ir-docs` directory structure.'img/project-logo.png' => `/${projectName}/img/project-logo.png`
-
Components consume this via the docusaurus context.