Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store images on the repo #10

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This is a gallery of [Voici](https://github.com/voila-dashboards/voici) examples
- `branch`: the branch to be checked out from `repo_url` repository, default to `main`.
- `dashboard_url`: the URL of the deployed voici dashboard. If the voici dashboard is already deployed elsewhere you can use this field to bypass the build step. If you use this option, you do not need to provide the `repo_url`, `content_path` and the `branch` field.
- `image_url`: the URL of the picture to use as thumbnail.
- `image_path`: alternate way to provide your thumbnail image, by adding it to the `public/images` directory on this repository and providing the path in this parameter.
3. Once the PR is merged into `main`, the gallery is automatically redeployed and the new example will be visible shortly after.

## Development
Expand Down
Binary file added public/images/voici-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion script/gallery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description: A simple Voici demo using bqplot and ipywidgets
content_path: content/demo.ipynb
repo_url: https://github.com/voila-dashboards/voici-demo
image_url: https://private-user-images.githubusercontent.com/21197331/286634630-07e1a426-78d6-4885-92bb-0678674111be.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTEiLCJleHAiOjE3MDEyNjk2NjIsIm5iZiI6MTcwMTI2OTM2MiwicGF0aCI6Ii8yMTE5NzMzMS8yODY2MzQ2MzAtMDdlMWE0MjYtNzhkNi00ODg1LTkyYmItMDY3ODY3NDExMWJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFJV05KWUFYNENTVkVINTNBJTJGMjAyMzExMjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjMxMTI5VDE0NDkyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBjY2JjMjk0NzlhNDZjYjkzODdjYzQ4YWFhMTBlMzZjNTFmZDQ2NzgyZWZkNmNjZjg3OTAxOTc3OWQwODhlMzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.HqsMLfvKzXl_6gybreSzS1oZ8mrwni1YEjSpXLAcacc
image_path: voici-demo.png

- title: stock-dashboard
description: SP500 stock dashboard
Expand Down
3 changes: 2 additions & 1 deletion src/GalleryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IGalleryItemProps {
title: string;
repo_url: string;
dashboard_url: string;
image_path?: string;
image_url?: string;
description?: string;
}
Expand All @@ -32,7 +33,7 @@ export function GalleryItem(props: IGalleryItemProps) {
>
<CardMedia
sx={{ height: 175, backgroundSize: 'contain', cursor: 'pointer' }}
image={props.image_url ?? ''}
image={props.image_path ? `./images/${props.image_path}` : props.image_url ?? ''}
title={props.title}
onClick={openNewTab}
/>
Expand Down
Loading