Skip to content

Commit 5fa0012

Browse files
committed
Add Resources and YouTubeEmbed.vue
1 parent 18fae44 commit 5fa0012

File tree

6 files changed

+77
-1
lines changed

6 files changed

+77
-1
lines changed

.vitepress/config.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default defineConfig({
3838
config(md) {
3939
md.use(groupIconMdPlugin)
4040
},
41+
// toc: { level: [2] },
4142
},
4243

4344
title: settings.title,
@@ -124,6 +125,7 @@ export default defineConfig({
124125
{ text: 'Get Started', link: '/get-started' },
125126
{ text: 'Features', link: '/features' },
126127
{ text: 'Examples', link: '/examples' },
128+
{ text: 'Resources', link: '/resources' },
127129
//
128130
],
129131
},
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<script setup>
2+
const props = defineProps({
3+
title: { type: String, default: 'YouTube video player' },
4+
style: { type: String, default: 'margin: 16px 0' },
5+
src: { type: String, default: null }, // Source URL overrides all other parameters
6+
videoId: { type: String, default: null }, // Video ID used with other parameters
7+
autoplay: { type: String, default: '0' },
8+
controls: { type: String, default: '1' },
9+
loop: { type: String, default: '0' },
10+
rel: { type: String, default: '0' },
11+
start: { type: String, default: null },
12+
})
13+
14+
let srcUrl
15+
if (props.src) {
16+
srcUrl = props.src
17+
} else if (props.videoId) {
18+
const params = new URLSearchParams({
19+
autoplay: props.autoplay,
20+
controls: props.controls,
21+
loop: props.loop,
22+
rel: props.rel,
23+
})
24+
if (props.start) params.set('start', props.start)
25+
srcUrl = `https://www.youtube-nocookie.com/embed/${props.videoId}?${params.toString()}`
26+
} else {
27+
console.warn('%c YouTubeEmbed', 'color: Red', 'Missing param: videoId or src')
28+
}
29+
// console.debug('%c YouTubeEmbed', 'color: Red', 'srcUrl:', srcUrl)
30+
</script>
31+
32+
<template>
33+
<iframe
34+
width="100%"
35+
:style="props.style"
36+
:src="srcUrl"
37+
:title="props.title"
38+
frameborder="0"
39+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
40+
referrerpolicy="strict-origin-when-cross-origin"
41+
allowfullscreen
42+
></iframe>
43+
</template>
44+
45+
<style scoped>
46+
iframe {
47+
aspect-ratio: 16 / 9;
48+
}
49+
</style>

.vitepress/theme/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import DefaultTheme from 'vitepress/theme'
22
import './custom.css'
33
import 'virtual:group-icons.css'
44

5+
import YouTubeEmbed from './components/YouTubeEmbed.vue'
6+
57
// noinspection JSUnusedGlobalSymbols
68
export default {
79
...DefaultTheme,
10+
11+
enhanceApp({ app }) {
12+
app.component('YouTubeEmbed', YouTubeEmbed)
13+
},
814
}

docs/docs/inputs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The inputs are organized in a table for quick [reference](#reference) with addit
1212
| [file](#file) | `docker-compose.yaml` | Docker Stack/Compose File(s) |
1313
| [mode](#mode) **¹** | `swarm` | Deploy Mode [`swarm`, `compose`] |
1414
| [args](#args) **¹** | `--remove-orphans --force-recreate` | Additional **Compose** Arguments |
15-
| [host](#host) | - | Remote Docker Hostname or IP |
15+
| [host](#host) **\*** | - | Remote Docker Hostname or IP |
1616
| port | `22` | Remote Docker Port |
1717
| user **\*** | - | Remote Docker Username |
1818
| [pass](#pass-ssh-key) **\*** | - | Remote Docker Password |

docs/guides/get-started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ For this you should use: [cssnr/portainer-stack-deploy-action](https://github.co
9090
For more details see the [README.md](https://github.com/cssnr/portainer-stack-deploy-action?tab=readme-ov-file#readme) on GitHub.
9191
[Support](https://github.com/cssnr/portainer-stack-deploy-action?tab=readme-ov-file#Support) is also available.
9292

93+
&nbsp;
94+
9395
::: info FEATURE REQUEST
9496
If you need more options, please [open a feature request](https://github.com/cssnr/stack-deploy-action/discussions/categories/feature-requests)
9597
:::

docs/guides/resources.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Resources
2+
3+
A collection of resources and guides for getting started.
4+
5+
[[toc]]
6+
7+
## Video Guides
8+
9+
### Docker Stack VPS Guide
10+
11+
<YouTubeEmbed video-id="fuZoxuBiL9o" />
12+
13+
&nbsp;
14+
15+
::: tip
16+
Have a related resource? Let us know by creating a [PR](https://github.com/cssnr/stack-deploy-docs/edit/master/docs/guides/examples.md) or an [Issue](https://github.com/cssnr/stack-deploy-docs/issues).
17+
:::

0 commit comments

Comments
 (0)