Skip to content

Commit 3b9259a

Browse files
author
Lucas Elzinga
committed
closes #10
1 parent 8584744 commit 3b9259a

10 files changed

Lines changed: 1141 additions & 54 deletions

File tree

.github/workflows/deploy-demo.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy Demo to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
cache: 'npm'
29+
30+
- name: Install root dependencies
31+
run: npm ci
32+
33+
- name: Build package
34+
run: npm run build
35+
36+
- name: Install demo dependencies
37+
run: |
38+
cd demo
39+
npm ci
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v4
43+
44+
- name: Build demo for GitHub Pages
45+
run: |
46+
cd demo
47+
npm run build
48+
env:
49+
NODE_ENV: production
50+
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: './demo/build'
55+
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
<a href="https://github.com/lzinga/mdsvex-enhanced-images/commits/main/"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/lzinga/mdsvex-enhanced-images"></a>
77
</p>
88

9+
<p align="center">
10+
<strong>🚀 <a href="https://lzinga.github.io/mdsvex-enhanced-images/">Live Demo</a></strong>
11+
</p>
912

10-
This plugin allows you to:
13+
This plugin allows you to:
1114
- use relative urls to images from the markdown file while also using the `enhanced:img` library from `@sveltejs/enhanced-img`.
1215
- add CSS class names and extra attributes (`loading`, `fetchpriority`, and `decoding`) to images directly in markdown (image by image) or through the plugin configuration (to all images).
1316
- add imagetools directives to images in markdown (image by image) or through the plugin configuration (to all images).
@@ -16,6 +19,38 @@ Special thanks to https://github.com/mattjennings/mdsvex-relative-images, for th
1619

1720
Feel free to open a PR or an issue if you have any suggestions or feature requests!
1821

22+
## 🎯 Live Demo
23+
24+
Experience the plugin in action with our [interactive demo](https://lzinga.github.io/mdsvex-enhanced-images/) hosted on GitHub Pages. The demo showcases:
25+
26+
- **Basic image processing** with automatic `enhanced:img` component generation
27+
- **CSS class application** via URL parameters
28+
- **HTML attribute injection** for performance optimization
29+
- **Image processing directives** like rotation, tinting, and effects
30+
- **Real-time examples** of all plugin features
31+
32+
The demo is automatically deployed from the `/demo` directory using SvelteKit's static adapter.
33+
34+
### 🛠️ Local Demo Development
35+
36+
To run the demo locally for testing and development:
37+
38+
```bash
39+
# Install demo dependencies
40+
npm run demo:install
41+
42+
# Run demo in development mode (with hot reloading)
43+
npm run demo:dev
44+
45+
# Build and serve demo locally (mimics production)
46+
npm run demo:serve
47+
48+
# Build demo only
49+
npm run demo:build
50+
```
51+
52+
These scripts will automatically build the plugin first, then set up the demo environment.
53+
1954
## Contributors
2055

2156
<!-- readme: collaborators,contributors -start -->

0 commit comments

Comments
 (0)