Skip to content

Instantly share code, notes, and snippets.

@freekrai
Created March 12, 2012 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freekrai/2019415 to your computer and use it in GitHub Desktop.
Save freekrai/2019415 to your computer and use it in GitHub Desktop.
Second crack
<?php
// ----- Don't edit this -----------------
require_once(dirname(__FILE__) . '/engine/Updater.php');
// ---------------------------------------
// ----- You can edit these settings: -----
date_default_timezone_set('America/New_York'); // Sometimes I hate PHP. This is one of those times.
// Paths
Updater::$source_path   = '/home/123916/users/.home/domains/defiantapp.com/secondcrack/';
Template::$template_dir = '/home/123916/users/.home/domains/defiantapp.com/secondcrack/templates';
Updater::$dest_path     = '/home/123916/users/.home/domains/defiantapp.com/html/';
Updater::$cache_path    = '/home/123916/users/.home/domains/defiantapp.com/html/cache';
Updater::$post_extension = '.txt';
// Blog metadata
Post::$blog_title = 'Defiant App';
Post::$blog_url   = 'http://defiantapp.com/';
Post::$blog_description = 'I\'m a blogger.';
// Meta Weblog API params
Updater::$api_blog_id = 1; // leave this, probably
Updater::$api_blog_username = 'username here';
Updater::$api_blog_password = 'abcdefg';
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss.xml" />
<meta name="viewport" content="width=device-width" />
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon.png"/>
<title><?= 
(isset($content['post']) ? h($content['post']['post-title']) . ' &ndash; ' : '') . 
($content['page-title'] != $content['blog-title'] && (
$content['page-type'] == 'page' || $content['page-type'] == 'archive' || $content['page-type'] == 'tag' || $content['page-type'] == 'type' 
) ? h($content['page-title']) . ' &ndash; ' : '') . 
h($content['blog-title']) 
?></title>
<? if ($content['page-type'] != 'frontpage' && $content['page-type'] != 'page' && $content['page-type'] != 'post') { ?>
<meta name="robots" content="noindex"/>
<? } ?>
<link href="/assets/css/bootstrap.css" rel="stylesheet">
<link href="/assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/assets/css/custom.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="/assets/js/bootstrap.js"></script>
<script src="/assets/js/app.js"></script>
</head>
<body>
<header>
<div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="/">Roger Stringer</a>
          <div class="nav-collapse">
            <ul class="nav">
              <li class="<?=($content['page-type'] == 'frontpage' ? "active" : null)?>"><a href="/">Home</a></li>
              <li><a href="/about">About</a></li>
<?/*
              <li><a href="/contact">Contact</a></li>
              <li><a href="http://twitter.com/freekrai">Twitter</a></li>
*/?>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>
</header>    
<section id="posts">
<? if ($content['page-type'] == 'page') { ?>
<article>
<header>
<h2><?= h($content['page-title']) ?></h2>
</header>
<?= $content['page-body'] ?>
</article>
<? } else { ?>
<? if (isset($content['posts'])) foreach ($content['posts'] as $post) { ?>
<article<?= $post['post-type'] == 'link' ? ' class="link"' : '' ?>>
<header>
<h2>
<a href="<?= h($post['post-permalink-or-link']) ?>"><?= h($post['post-title']) ?></a>
<?= $post['post-type'] == 'link' ? '<span class="linkarrow">&rarr;</span>' : '' ?>
</h2>
<p>
<time datetime="<?= h(date('c', $post['post-timestamp'])) ?>" pubdate="pubdate"><?= date('F j, Y', $post['post-timestamp']) ?></time>
&bull;
<a class="permalink" title="Permalink" href="<?= h($post['post-permalink']) ?>">∞</a>&nbsp;
<iframe border="0" scrolling="no" width="78" height="17" allowtransparency="true" frameborder="0" style="margin-bottom: -3px; z-index: 1338; border: 0px; background-color: transparent; overflow: hidden;" src="http://www.instapaper.com/e2?url=<?= h($post['post-permalink-or-link']) ?>"></iframe>
</p>
</header>
<?= $post['post-body'] ?>
<?php if( $content['page-type'] == 'post' ){ ?>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'defiantapp';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
<?php } ?>
</article>
<? } ?>
<? } ?>
<?php if( $content['page-type'] != 'post' && $content['page-type'] != 'page' ){ ?>
<hr class="harden" />
<? if (isset($content['archives'])) { ?>
<nav id="archives">
<h3>Archives</h3> 
<div style="clear: both; font-size: 1px; line-height: 1px;">&nbsp;</div>
<div style="float: left; width: 90px; text-align: right; padding-bottom: 2em;">
<? $so_far = 0; $per_column = ceil(count($content['archives']) / 5); ?>
<? foreach ($content['archives'] as $archive) { ?>
<? if (++$so_far > $per_column) { ?>
<? $so_far = 1; ?>
</div>
<div style="float: left; width: 90px; text-align: right;">
<? } ?>
<a href="<?= h($archive['archives-uri']) ?>"><?= $archive['archives-month-short-name'] ?>&nbsp;<?= $archive['archives-year'] ?></a>
<br/>
<? } ?>
</div>
<div style="clear: both; font-size: 1px; line-height: 1px;">&nbsp;</div>
</nav>
<? } ?>
<?php } ?>
<hr class="harden" />
<footer>
<p>&copy; 2006-2012 Roger Stringer. All rights reserved.</p>
<p>
<a href="/rss.xml">RSS feed</a>.
Powered by <a href="http://www.marco.org/secondcrack">Second Crack</a>.
</p>
</footer>
</section>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment