<?php

require 'base.php';
require 'tumblr.php';

$tumblr = new Tumblr();
$post   = $tumblr->find_post_by_slug($slug);

include 'header.php' ?>

<div id="main" role="main">
  <article>
    <?php if ($post->has_image()): ?>
      <img class="post-image"
           src="<?php echo $post->image_url() ?>"
           alt="<?php echo $post->title() ?>">
    <?php endif ?>

    <?php if ($post->has_player()): ?>
      <div class="player">
        <?php echo $post->player() ?>
      </div>
    <?php endif ?>

    <div class="container">
      <h1><?php echo $post->title() ?></h1>
      <div class="text"><?php echo $post->description() ?></div>
    </div>
  </article>
</div>

<?php include 'footer.php' ?>