mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
tpl: Add title parameter to YouTube shortcode
This commit is contained in:
parent
0ad378b09c
commit
4fc918e02c
4 changed files with 19 additions and 6 deletions
|
@ -184,6 +184,11 @@ func TestShortcodeYoutube(t *testing.T) {
|
|||
`{{< youtube id="w7Ft2ymGmfc" class="video" autoplay="true" >}}`,
|
||||
"(?s)\n<div class=\"video\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\\?autoplay=1\".*?allowfullscreen title=\"YouTube Video\">.*?</iframe>.*?</div>",
|
||||
},
|
||||
// set custom title for accessability)
|
||||
{
|
||||
`{{< youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" >}}`,
|
||||
"(?s)\n<div style=\".*?\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\" style=\".*?\" allowfullscreen title=\"A New Hugo Site in Under Two Minutes\">.*?</iframe>.*?</div>",
|
||||
},
|
||||
} {
|
||||
var (
|
||||
cfg, fs = newTestCfg()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue