Skip to content

Commit

Permalink
add astro-product-gallery example
Browse files Browse the repository at this point in the history
  • Loading branch information
geekysrm committed Oct 2, 2023
1 parent 3f3ece4 commit 015dff7
Show file tree
Hide file tree
Showing 10 changed files with 6,208 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/astro-product-gallery/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/

# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
46 changes: 46 additions & 0 deletions examples/astro-product-gallery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Astro Cloudinary Product Gallery Widget

You can use the Product Gallery widget to display an image gallery in your
application.

View Demo: [COLBY DEPLOY THIS ON NETLIFY PLS]

## 🧰 Using ProductGallery in a Astro project

To use the ProductGallery widget in a Astro app, first load its script:

```
<script src="https://product-gallery.cloudinary.com/all.js" type="text/javascript">
</script>
```

This will add a `cloudinary` property to the `window` object which will contain
a `productWidget` method that you can use to initialize the widget.

## 🚀 Get Started with This Example

- Create an environment variable file `.env` and inside add:

```
VITE_CLOUDINARY_CLOUD_NAME="<Your Cloud Name>"
```

(Also ensure you have unticked "Resource List" from Restricted media types in [Settings > Security](https://console.cloudinary.com/settings/security))

- Install the project dependencies with:

```
yarn install
# or
npm install
```

- Start the development server with:

```
yarn dev
# or
npm run dev
```

- Visit the project at <http://127.0.0.1:4321/>!
4 changes: 4 additions & 0 deletions examples/astro-product-gallery/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({});
Loading

0 comments on commit 015dff7

Please sign in to comment.