mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 16:15:12 +00:00
Add video shortcode and remove image shadow
This commit is contained in:
1 parent
b02f5eceda
commit
66b71fa2f6
2 files changed
+19
-3
No files matched your search
@@ -127,6 +127,12 @@ video {
|
||||
display: block;
|
||||
}
|
||||
|
||||
video {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: 400px;
|
||||
}
|
||||
|
||||
.img-responsive {
|
||||
/* Extend Bootstrap declaration with centering. */
|
||||
margin: 0 auto;
|
||||
@@ -652,13 +658,11 @@ article .article-metadata {
|
||||
|
||||
.article-style img,
|
||||
.article-style video {
|
||||
box-shadow: 1px 1px 0px #edefed, -1px -1px 0px #edefed, 1px -1px 0px #edefed, -1px 1px 0px #edefed;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 60px;
|
||||
margin-bottom: 60px;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.article-style td img,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{{ $directory := "img/" }}
|
||||
{{ $video := printf "%s%s" $directory (.Get "src") }}
|
||||
{{ $video_type := substr (.Get "src") -1 3 }}
|
||||
{{ $poster := printf "%s%s%s" $directory (substr (.Get "src") 0 -4) ".jpg" }}
|
||||
{{ if fileExists (printf "%s%s" "static/" $poster) }}
|
||||
{{ .Scratch.Set "poster" ($poster | absURL) }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "poster" "" }}
|
||||
{{ end }}
|
||||
<video {{if (.Get "controls")}}controls{{else}}autoplay loop{{end}} {{with .Scratch.Get "poster"}}poster="{{.}}"{{end}}>
|
||||
<source src="{{ $video | relURL }}" type="video/{{$video_type}}">
|
||||
</video>
|
||||
Reference in new issue
Block a user