mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 03:26:22 +00:00
fix: responsive youtube embed (closes #1167)
This commit is contained in:
parent
6c4ed249ba
commit
ca3943b500
2 changed files with 9 additions and 4 deletions
|
@ -616,11 +616,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
||||||
// YouTube video (with optional playlist)
|
// YouTube video (with optional playlist)
|
||||||
node.tagName = "iframe"
|
node.tagName = "iframe"
|
||||||
node.properties = {
|
node.properties = {
|
||||||
class: "external-embed",
|
class: "external-embed youtube",
|
||||||
allow: "fullscreen",
|
allow: "fullscreen",
|
||||||
frameborder: 0,
|
frameborder: 0,
|
||||||
width: "600px",
|
width: "600px",
|
||||||
height: "350px",
|
|
||||||
src: playlistId
|
src: playlistId
|
||||||
? `https://www.youtube.com/embed/${videoId}?list=${playlistId}`
|
? `https://www.youtube.com/embed/${videoId}?list=${playlistId}`
|
||||||
: `https://www.youtube.com/embed/${videoId}`,
|
: `https://www.youtube.com/embed/${videoId}`,
|
||||||
|
@ -629,11 +628,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
||||||
// YouTube playlist only.
|
// YouTube playlist only.
|
||||||
node.tagName = "iframe"
|
node.tagName = "iframe"
|
||||||
node.properties = {
|
node.properties = {
|
||||||
class: "external-embed",
|
class: "external-embed youtube",
|
||||||
allow: "fullscreen",
|
allow: "fullscreen",
|
||||||
frameborder: 0,
|
frameborder: 0,
|
||||||
width: "600px",
|
width: "600px",
|
||||||
height: "350px",
|
|
||||||
src: `https://www.youtube.com/embed/videoseries?list=${playlistId}`,
|
src: `https://www.youtube.com/embed/videoseries?list=${playlistId}`,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -541,3 +541,10 @@ ol.overflow {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.external-embed.youtube {
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue