feat: video static thumbnails (#164)

Closes #163 

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2018-07-29 09:44:15 +01:00 committed by GitHub
parent 94e5cf2f44
commit cd0e7d775e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 16 deletions

View file

@ -5,7 +5,10 @@ icon: stroke_speaker
content: content:
- title: IPFS Alpha - Why we must redistribute the web - title: IPFS Alpha - Why we must redistribute the web
website: https://www.youtube.com/watch?v=skMTdSEaCtA website: https://www.youtube.com/watch?v=skMTdSEaCtA
picture: /images/ipfs-alpha.jpg
- title: Juan Benet at Stanford 2015 - title: Juan Benet at Stanford 2015
website: https://www.youtube.com/watch?v=HUVmypx9HGI website: https://www.youtube.com/watch?v=HUVmypx9HGI
picture: /images/stanford-2015.jpg
- title: Juan Benet at Fullstack Fest 2016 - title: Juan Benet at Fullstack Fest 2016
website: https://www.youtube.com/watch?v=jONZtXMu03w website: https://www.youtube.com/watch?v=jONZtXMu03w
picture: /images/fullstack-fest-2016.jpg

View file

@ -8,13 +8,9 @@ const contentDir = path.join(__dirname, '../src/content')
const indexesDir = path.join(__dirname, '../src/layouts/partials/indexes') const indexesDir = path.join(__dirname, '../src/layouts/partials/indexes')
const processDataType = (data) => { const processDataType = (data) => {
const content = data.content.map((info, index) => { const content = data.content.map(info => {
const { website, ...more } = info const { website, ...more } = info
if (data.title === 'Videos' && website.includes('youtube')) {
more.youtube = website.replace('https://www.youtube.com/watch?v=', '')
}
return { return {
website: website, website: website,
categories: [data.title.toLowerCase()], categories: [data.title.toLowerCase()],

View file

@ -39,17 +39,9 @@
{{- if isset .Params "picture" -}} {{- if isset .Params "picture" -}}
<div class="mt2 mw5"> <div class="mt2 mw5">
<a target="_blank" class="no-underline charcoal" href="{{ if .Params.website }}{{ .Params.website }}{{ else if .Params.source }}{{ .Params.source }}{{ else if .Params.demo }}{{ .Params.demo }}{{ end }}">
<img class="br2" src="{{ .Site.BaseURL }}{{ .Params.picture }}" > <img class="br2" src="{{ .Site.BaseURL }}{{ .Params.picture }}" >
</div> </a>
{{ end }}
{{- if isset .Params "youtube" -}}
<div class="relative mt2 mw5" style="height: 0; padding-bottom: 56.25%">
<iframe class="absolute top-0 left-0 w-100 h-100"
type="text/html"
src="https://www.youtube.com/embed/{{ .Params.youtube }}"
allowfullscreen
frameborder="0"></iframe>
</div> </div>
{{ end }} {{ end }}

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB