pret
This commit is contained in:
parent
d860e3d987
commit
c8008a4f20
208 changed files with 8919 additions and 146 deletions
5
layouts/shortcodes/machin.html
Normal file
5
layouts/shortcodes/machin.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<a href="{{ .Get "url" }}">{{ .Inner }}</a>
|
||||
|
||||
{{/* utilisation: }}
|
||||
{{<machin url="https://example.com">}}Hello{{</machin>}}
|
||||
{{ */}}
|
10
layouts/shortcodes/youtube.html
Normal file
10
layouts/shortcodes/youtube.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{{ $code := "helloworld" }}
|
||||
{{ if (.Get "code") }}
|
||||
{{ $code = (.Get "code") }}
|
||||
{{ else if (.Get "src") }}
|
||||
{{ $code = (.Get "src") }}
|
||||
{{ (strings.ReplaceRE `(http(?:s)?:\/\/(?:www\.)?youtu(?:(?:be\.com)|(?:\.be))|(?:be-nocookie\.com))\/(?:(?:watch\?v=)|(?:embed\/)|(?:\/v\/))?(.+)?(?:\&|\?)` "" $code) }}
|
||||
|
||||
{{ end }}
|
||||
<img src="http://i3.ytimg.com/vi/{{ .Get "code" }}/hqdefault.jpg"/>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue