pebblecode / pebblecode.github.io

Jekyll powered pebblecode.com site
5 stars 5 forks source link

Enhanced blog post media #89

Closed petertait closed 8 years ago

petertait commented 8 years ago

This adds the ability to include images and youtube videos using a single line direct into the blog post's markdown file. Added feature is the ability to also include an option caption which can double up for alt text.

Youtube

New: {% include youtube.html id="QmAl2cg3C5U" caption="This is an excellent video" %}

Current: <div class="video"><iframe width="532" height="400" src="//www.youtube.com/embed/QmAl2cg3C5U" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>

Image (with caption)

New: {% include image.html url="/img/posts/2016-05-17-screen-saver/screen.gif" caption="Our Propsboard dashboard in action" %}

Current (still works, but without caption): ![Our Propsboard dashboard in action](/img/posts/2016-05-17-screen-saver/screen.gif)

Thoughts?

shapeshed commented 8 years ago

Nice abstraction 🎉

export-mike commented 8 years ago

👍 so does this remove the issue https://github.com/pebblecode/pebblecode.github.io/issues/85 ?

petertait commented 8 years ago

No I don't think so, you might be able to use the same technique though. For example, creating a template for video with gif fallback which would use the same {include} markup in the markdown file.

I'll have a look into this and see if possible.

export-mike commented 8 years ago

@petertait cool! I can imagine there would be some js stuff still to load in the video elements, as I think theres a check for is mobile. unless we can do a mobile first approach in someway which doesnt require js?