Skip to content

Latest commit

 

History

History
108 lines (81 loc) · 2.66 KB

using-images-and-videos.adoc

File metadata and controls

108 lines (81 loc) · 2.66 KB

Using Images and Videos

Previous: Using source code in your site

Tutorial 11

This tutorial…​

Images

Make a directory for images in the project root

$ mkdir images

Download some example images into the images directory

Include an inline image in a post written in AsciiDoc

image:oscon-mascot.jpg[role="thumb right"] I'm excited to be at OSCON 2013.
I'm currently attending a workshop on collaborative documentation.
We're learning about how to:

- setup a static website with Awestruct
- compose content in AsciiDoc
- collaborate on content using git and GitHub
- publish the website to GitHub Pages
- and lots more!

In fact, this website was launched during the workshop.
Note
The default images directory is /images. You don’t have to include the images directory in the image path. Asciidoctor will automatically resolve the image relative to the images directory. This also allows you to change the location of the images directory (or URL) without needing to update your content.

Include a block image in a post written in AsciiDoc

I can't wait to show my site to these GitHub guys.
They'll be proud ;)

[caption=""]
.GitHub trainers, Matthew and Tim
image::github-trainers.jpg[]

Add imagesdir attribute below document title to enable images in GitHub preview

Conditional hack to get post title to show on GitHub

[float]
= Docs Workshop at OSCON 2013

Videos

Include a video in a post written in AsciiDoc

.Mozilla Firefox Manifesto
[poster="http://www.mozilla.org/images/about/poster.jpg"]
video::http://videos-cdn.mozilla.net/brand/Mozilla_Firefox_Manifesto_v0.2_640.webm[]
Caution
The video macro is somewhat limited at the moment. It can’t yet handle YouTube videos. You could use a pass through block to insert HTML directly.

Next: Add Disqus Comments and Google Analytics