|
1 | 1 | --- |
2 | | -title: "Podcast Demo Site" |
| 2 | +title: "Podcast Player Demo" |
3 | 3 | --- |
4 | 4 |
|
5 | | -# Hugo Podcast Shortcode Demo |
| 5 | +<section class="hero"> |
| 6 | + <h1>Hugo Podcast Shortcode</h1> |
| 7 | + <p>A reusable <strong><podcast-player></strong> Web Component for Hugo — persistent audio playback with chapter navigation, poster support, and full accessibility. Drop it into any post with a single shortcode.</p> |
| 8 | +</section> |
6 | 9 |
|
7 | | -Welcome to the demo site for the [hugo-podcast-shortcode](https://github.com/adurrr/hugo-podcast-shortcode) module. |
| 10 | +<section class="demo-section"> |
| 11 | + <h2>📻 Basic Player</h2> |
| 12 | + <p class="desc">Minimal usage — just a <code>src</code> and <code>title</code>.</p> |
| 13 | + <div class="demo-player"> |
| 14 | + <div class="player-wrapper"> |
| 15 | + {{< podcast-player |
| 16 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" |
| 17 | + title="SoundHelix: Ambient Demo" |
| 18 | + >}} |
| 19 | + </div> |
| 20 | + </div> |
| 21 | + <div class="demo-code"> |
| 22 | + <code>\{\{< podcast-player |
| 23 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" |
| 24 | + title="SoundHelix: Ambient Demo" |
| 25 | +>\}\}</code> |
| 26 | + </div> |
| 27 | +</section> |
8 | 28 |
|
9 | | -## Episodes |
| 29 | +<section class="demo-section"> |
| 30 | + <h2>🎵 Player with Poster</h2> |
| 31 | + <p class="desc">Show an album-art poster alongside the controls.</p> |
| 32 | + <div class="demo-player"> |
| 33 | + <div class="player-wrapper"> |
| 34 | + {{< podcast-player |
| 35 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3" |
| 36 | + title="SoundHelix: Chilled Beats" |
| 37 | + poster="https://picsum.photos/seed/player1/400/400" |
| 38 | + >}} |
| 39 | + </div> |
| 40 | + </div> |
| 41 | + <div class="demo-code"> |
| 42 | + <code>\{\{< podcast-player |
| 43 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3" |
| 44 | + title="SoundHelix: Chilled Beats" |
| 45 | + poster="https://picsum.photos/seed/player1/400/400" |
| 46 | +>\}\}</code> |
| 47 | + </div> |
| 48 | +</section> |
10 | 49 |
|
11 | | -- [Test Episode](/posts/test-episode/) |
| 50 | +<section class="demo-section"> |
| 51 | + <h2>📖 Player with Chapters</h2> |
| 52 | + <p class="desc">Add timestamp-labelled chapters for easy navigation.</p> |
| 53 | + <div class="demo-player"> |
| 54 | + <div class="player-wrapper"> |
| 55 | + {{< podcast-player |
| 56 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-3.mp3" |
| 57 | + title="SoundHelix: Long Mix" |
| 58 | + poster="https://picsum.photos/seed/player2/400/400" |
| 59 | + chapters="00:00:00-Intro,00:00:45-Buildup,00:02:15-Main Theme,00:04:00-Bridge,00:05:30-Climax,00:06:45-Outro" |
| 60 | + persistent="true" |
| 61 | + >}} |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + <div class="demo-code"> |
| 65 | + <code>\{\{< podcast-player |
| 66 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-3.mp3" |
| 67 | + title="SoundHelix: Long Mix" |
| 68 | + poster="https://picsum.photos/seed/player2/400/400" |
| 69 | + chapters="00:00:00-Intro,00:00:45-Buildup,00:02:15-Main Theme,00:04:00-Bridge,00:05:30-Climax,00:06:45-Outro" |
| 70 | + persistent="true" |
| 71 | +>\}\}</code> |
| 72 | + </div> |
| 73 | +</section> |
| 74 | + |
| 75 | +<section class="demo-section"> |
| 76 | + <h2>💾 Persistence Demo</h2> |
| 77 | + <p class="desc">Toggle <code>persistent="true"</code> — the player saves your position, volume, mute, and playback speed to <code>sessionStorage</code>. Navigate between pages and resume where you left off. Try it on these two instances of the same audio:</p> |
| 78 | + |
| 79 | + <div class="demo-player"> |
| 80 | + <h3 style="font-size:1rem;margin-bottom:0.5rem">🔁 Player A (with persistence)</h3> |
| 81 | + <div class="player-wrapper"> |
| 82 | + {{< podcast-player |
| 83 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-4.mp3" |
| 84 | + title="SoundHelix: Persistent Player" |
| 85 | + persistent="true" |
| 86 | + >}} |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + <div class="demo-code" style="margin-bottom:1rem"> |
| 90 | + <code>\{\{< podcast-player src="…" title="SoundHelix: Persistent Player" persistent="true" >\}\}</code> |
| 91 | + </div> |
| 92 | + |
| 93 | + <div class="demo-player"> |
| 94 | + <h3 style="font-size:1rem;margin-bottom:0.5rem">🔁 Player B (no persistence)</h3> |
| 95 | + <div class="player-wrapper"> |
| 96 | + {{< podcast-player |
| 97 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-4.mp3" |
| 98 | + title="SoundHelix: Non-Persistent" |
| 99 | + persistent="false" |
| 100 | + >}} |
| 101 | + </div> |
| 102 | + </div> |
| 103 | + <div class="demo-code"> |
| 104 | + <code>\{\{< podcast-player src="…" title="SoundHelix: Non-Persistent" >\}\}</code> |
| 105 | + </div> |
| 106 | + <p class="desc" style="margin-top:0.75rem;font-size:0.85rem">💡 Play some of Player A, then reload the page — your position, volume, mute, and speed are remembered. Player B always starts fresh.</p> |
| 107 | +</section> |
| 108 | + |
| 109 | +<section class="demo-section"> |
| 110 | + <h2>🎨 Theming</h2> |
| 111 | + <p class="desc">Click the <strong>🌙 Dark / ☀️ Light</strong> toggle in the header to switch between built-in themes. The player responds to <code>data-theme</code> on <code><html></code>. You can also customise every visual aspect with <a href="https://github.com/adurrr/hugo-podcast-shortcode#css-custom-properties" target="_blank" rel="noopener">CSS custom properties</a> — primary colour, background, radius, progress height, and more.</p> |
| 112 | + <div class="demo-player"> |
| 113 | + <div class="player-wrapper"> |
| 114 | + {{< podcast-player |
| 115 | + src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-5.mp3" |
| 116 | + title="SoundHelix: Theme Demo" |
| 117 | + >}} |
| 118 | + </div> |
| 119 | + </div> |
| 120 | +</section> |
| 121 | + |
| 122 | +<section class="demo-section"> |
| 123 | + <h2>📋 All Shortcode Parameters</h2> |
| 124 | + <p class="desc">These can be passed per-invocation or set globally in <code>hugo.toml</code> under <code>[params.podcastPlayer]</code>:</p> |
| 125 | + |
| 126 | + <table style="width:100%;border-collapse:collapse;font-size:0.9rem"> |
| 127 | + <thead> |
| 128 | + <tr style="border-bottom:2px solid var(--border);text-align:left"> |
| 129 | + <th style="padding:0.5rem 0.75rem">Param</th> |
| 130 | + <th style="padding:0.5rem 0.75rem">Default</th> |
| 131 | + <th style="padding:0.5rem 0.75rem">Description</th> |
| 132 | + </tr> |
| 133 | + </thead> |
| 134 | + <tbody> |
| 135 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>src</code></td><td style="padding:0.5rem 0.75rem">—</td><td style="padding:0.5rem 0.75rem">Audio URL or local resource path</td></tr> |
| 136 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>title</code></td><td style="padding:0.5rem 0.75rem">—</td><td style="padding:0.5rem 0.75rem">Episode title (required for a11y)</td></tr> |
| 137 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>type</code></td><td style="padding:0.5rem 0.75rem"><code>local</code></td><td style="padding:0.5rem 0.75rem">Source type: <code>local</code>, <code>azuracast</code>, <code>ivoox</code></td></tr> |
| 138 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>persistent</code></td><td style="padding:0.5rem 0.75rem"><code>false</code></td><td style="padding:0.5rem 0.75rem">Save/resume playback in sessionStorage</td></tr> |
| 139 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>preload</code></td><td style="padding:0.5rem 0.75rem"><code>metadata</code></td><td style="padding:0.5rem 0.75rem">HTML5 <code><audio></code> preload hint</td></tr> |
| 140 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>autoplay</code></td><td style="padding:0.5rem 0.75rem"><code>false</code></td><td style="padding:0.5rem 0.75rem">Start playing on page load</td></tr> |
| 141 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>rate</code></td><td style="padding:0.5rem 0.75rem"><code>1</code></td><td style="padding:0.5rem 0.75rem">Playback speed multiplier</td></tr> |
| 142 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>poster</code></td><td style="padding:0.5rem 0.75rem">—</td><td style="padding:0.5rem 0.75rem">Cover image URL</td></tr> |
| 143 | + <tr style="border-bottom:1px solid var(--border)"><td style="padding:0.5rem 0.75rem"><code>chapters</code></td><td style="padding:0.5rem 0.75rem">—</td><td style="padding:0.5rem 0.75rem">Comma-separated <code>time-label</code> list</td></tr> |
| 144 | + <tr><td style="padding:0.5rem 0.75rem"><code>description</code></td><td style="padding:0.5rem 0.75rem">—</td><td style="padding:0.5rem 0.75rem">Rich text description (supports Markdown)</td></tr> |
| 145 | + </tbody> |
| 146 | + </table> |
| 147 | +</section> |
| 148 | + |
| 149 | +<section class="demo-section"> |
| 150 | + <h2>🔗 Links</h2> |
| 151 | + <ul class="link-list"> |
| 152 | + <li><a href="https://github.com/adurrr/hugo-podcast-shortcode" target="_blank" rel="noopener">GitHub Repository</a> — source code, issues, contributing</li> |
| 153 | + <li><a href="https://github.com/adurrr/hugo-podcast-shortcode#readme" target="_blank" rel="noopener">README</a> — full documentation, install guide, all CSS custom properties and <code>::part()</code> selectors</li> |
| 154 | + <li><a href="https://github.com/adurrr/hugo-podcast-shortcode?tab=readme-ov-file#keyboard-shortcuts" target="_blank" rel="noopener">Keyboard Shortcuts</a> — Space, arrows, M, and more</li> |
| 155 | + </ul> |
| 156 | +</section> |
0 commit comments