8 lines
445 B
HTML
8 lines
445 B
HTML
{{ $code := "helloworld" }}
|
|
{{ if (.Get "code") }}
|
|
{{ $code = (.Get "code") }}
|
|
{{ else if (.Get "src") }}
|
|
{{ $code = (.Get "src") }}
|
|
{{ $code = (strings.ReplaceRE `(http(?:s)?:\/\/(?:www\.)?youtu(?:(?:be\.com)|(?:\.be))|(?:be-nocookie\.com))\/(?:(?:watch\?v=)|(?:embed\/)|(?:\/v\/))?(.+)?(?:\&|\?)` "" $code) }}
|
|
<a class=youtubelink href="https://youtu.be/{{ $code }}"><img src="http://i3.ytimg.com/vi/{{ $code }}/hqdefault.jpg"/></a>
|
|
{{ end }}
|