Skip to content

Commit

Permalink
lots of changes, v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbartz committed Jan 14, 2012
1 parent d79e0ee commit 59cb96f
Show file tree
Hide file tree
Showing 16 changed files with 308 additions and 177 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Coming soon!

## Changelog

v 0.0.2 pre-alpha

* Added markdown
* Switched posts to be folder based instead of html
* Added archives/links to older blog posts

v 0.0.1 pre-alpha

* First working version
42 changes: 42 additions & 0 deletions frozn/_deploy/archives/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" href="/static/bootstrap.min.css">
<link rel="stylesheet" href="/static/frozn.css" type="text/css" media="all" />
<link rel="stylesheet" href="/static/prettify/prettify.css" type="text/css" media="all" />
<script type="text/javascript" src="/static/prettify/prettify.js"></script>

</head>

<body onload="prettyPrint()">
<div class="container span8">

<div class="header">
<ul class="tabs">
<li class="active"><a href="/">Blog</a></li>
<!--<li><a href="#">Portfolio <span class="label warning">External</span></a></li>-->
<li><a target="_blank" href="http://twitter.com/jasonbartz">@jasonbartz <span class="label warning">External</span></a></li>
<!--<li><a href="#">Contact</a></li>-->
</ul>
<h1>Jason Bartz</h1>

</div>


<div class="content">



<p><strong>2012-1-19 - </strong><a href="/posts/testing-markdown">testing-markdown</a></p>

<p><strong>2012-1-12 - </strong><a href="/posts/new-blog-design-and-infrastructure">new-blog-design-and-infrastructure</a></p>

<p><strong>2011-2-4 - </strong><a href="/posts/configuring-coda-and-sftp-to-work-with-amazon-aws">configuring-coda-and-sftp-to-work-with-amazon-aws</a></p>



</div>
</div>
</body>
</html>
67 changes: 67 additions & 0 deletions frozn/_deploy/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" href="/static/bootstrap.min.css">
<link rel="stylesheet" href="/static/frozn.css" type="text/css" media="all" />
<link rel="stylesheet" href="/static/prettify/prettify.css" type="text/css" media="all" />
<script type="text/javascript" src="/static/prettify/prettify.js"></script>

</head>

<body onload="prettyPrint()">
<div class="container span8">

<div class="header">
<ul class="tabs">
<li class="active"><a href="/">Blog</a></li>
<!--<li><a href="#">Portfolio <span class="label warning">External</span></a></li>-->
<li><a target="_blank" href="http://twitter.com/jasonbartz">@jasonbartz <span class="label warning">External</span></a></li>
<!--<li><a href="#">Contact</a></li>-->
</ul>
<h1>Jason Bartz</h1>

</div>


<div class="content">


<div class="headline"><h2>Testing markdown</h2></div>
<div class="meta">
<div class="datetime">2012-1-19 </div>
</div>
<div class="post_body">

<p>This is a paragraph</p><div class="codeblock">
<pre class="prettyprint">

vim ~/.ssh/config

</pre>
</div>
<p>Here is another.</p>
<p>And one more paragraph.</p>
<ul>
<li>bullets</li>
<li>boom</li>
</ul>

</div>

<h3>Previous posts</h3>

<p><strong>2012-1-19 - </strong><a href="/posts/testing-markdown">testing-markdown</a></p>

<p><strong>2012-1-12 - </strong><a href="/posts/new-blog-design-and-infrastructure">new-blog-design-and-infrastructure</a></p>

<p><strong>2011-2-4 - </strong><a href="/posts/configuring-coda-and-sftp-to-work-with-amazon-aws">configuring-coda-and-sftp-to-work-with-amazon-aws</a></p>


<p><a href="/archives/">Archives</a></p>


</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<div class="header">
<ul class="tabs">
<li class="active"><a href="#">Blog</a></li>
<li class="active"><a href="/">Blog</a></li>
<!--<li><a href="#">Portfolio <span class="label warning">External</span></a></li>-->
<li><a target="_blank" href="http://twitter.com/jasonbartz">@jasonbartz <span class="label warning">External</span></a></li>
<!--<li><a href="#">Contact</a></li>-->
Expand All @@ -37,35 +37,29 @@ <h1>Jason Bartz</h1>
<p><strong>The problem</strong></p>
<p>You use Amazon AWS for your sweet apps and maybe do a bit of development in the cloud. You want an easy way to transfer files without dragging and dropping.</p>
<p><strong>Requirements</strong></p>
<p>Amazon AWS Server</p>
<p>Coda (Mac OSX)</p>
<p>vim</p>
<ul>
<li>Amazon AWS Server</li>
<li>Coda (Mac OSX)</li>
<li>vim</li>
</ul>
<p><strong>The configuration</strong></p>
<p>This config is specifically for Coda, however, I imagine it will work for other editors with SFTP ability.</p>
<p>First off, <a href="http://docs.amazonwebservices.com/AWSEC2/latest/GettingStartedGuide/" target="_blank">make sure you have the .pem file from AWS. </a></p>
<p>Copy that file to your ssh configuration direction</p>

<div class="codeblock">
<p>Copy that file to your ssh configuration direction</p><div class="codeblock">
<pre class="prettyprint">

cp /path/to/your-keypair.pem ~/.ssh/your-keypair.pem

</pre>
</div>


<p>Next, add it to your ssh config file</p>

<div class="codeblock">
</div>
<p>Next, add it to your ssh config file</p><div class="codeblock">
<pre class="prettyprint">

vim ~/.ssh/config

</pre>
</div>


<div class="codeblock">
</div>
<div class="codeblock">
<pre class="prettyprint">

Host thenameyouwannause
Expand All @@ -74,25 +68,19 @@ <h1>Jason Bartz</h1>
User root

</pre>
</div>


<p>You&#8217;ll want to test it:</p>

<div class="codeblock">
</div>
<p>You&#8217;ll want to test it:</p><div class="codeblock">
<pre class="prettyprint">

ssh thenameyouwannause

</pre>
</div>


<p>It should connect OK and get you to your server. You may have to modify permissions on that file to get it to work properly. If not, something is wrong and likely out of the scope of this article.</p>
</div>
<p>It should connect OK and get you to your server. You may have to modify permissions on that file to get it to work properly. If not, something is wrong and likely out of the scope of this article.</p>
<p>Now you&#8217;ll want to add a site to Coda.</p>
<p>The parts we care about:</p>
<p><em>Connecting</em></p>
<p><em>Terminal</em></p>
<p><em><em>Connecting</em>
</em><em>Terminal</em></p>
<p>In the latest version of Coda, when you select SFTP, the <em>Terminal</em> should automatically reflect what you type under <em>Connecting</em>.</p>
<p>First, change the Protocol to STFP. Next to server type thenameyouwannause. User name should be root. Leave password blank and Port at 22. Do not check the password prompt box.</p>
<p>Fill in the other information and give it a shot.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<div class="header">
<ul class="tabs">
<li class="active"><a href="#">Blog</a></li>
<li class="active"><a href="/">Blog</a></li>
<!--<li><a href="#">Portfolio <span class="label warning">External</span></a></li>-->
<li><a target="_blank" href="http://twitter.com/jasonbartz">@jasonbartz <span class="label warning">External</span></a></li>
<!--<li><a href="#">Contact</a></li>-->
Expand All @@ -33,18 +33,12 @@ <h1>Jason Bartz</h1>
</div>
<div class="post_body">

<p> A brand new year and a brand new blog design.</p>

<p>A brand new year and a brand new blog design.</p>
<p>This blog is now a static site, powered by a custom static blog generator I wrote in Python called <a href="https://github.com/jasonbartz/frozn" target="_blank">Frozn</a></p>

<p>It's a work in progress, but I wanted to get it out there for the beginning part of the new year.</p>

<p>I've included one technical post from my old blog, which will soon be available at the archives when they are live, but for now, enjoy the design and the code.</p>

<p>Design powered by <a target="_blank" href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a>.</p>

<p>Blog powered by <a href="https://github.com/jasonbartz/frozn" target="_blank">Frozn</a> and <a target="_blank" href="http://jinja.pocoo.org/docs/">Jinja2</a></p>

<p>Blog powered by <a href="https://github.com/jasonbartz/frozn" target="_blank">Frozn</a> and <a target="_blank" href="http://jinja.pocoo.org/docs/">Jinja2</a></p>

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<div class="header">
<ul class="tabs">
<li class="active"><a href="#">Blog</a></li>
<li class="active"><a href="/">Blog</a></li>
<!--<li><a href="#">Portfolio <span class="label warning">External</span></a></li>-->
<li><a target="_blank" href="http://twitter.com/jasonbartz">@jasonbartz <span class="label warning">External</span></a></li>
<!--<li><a href="#">Contact</a></li>-->
Expand All @@ -27,29 +27,29 @@ <h1>Jason Bartz</h1>
<div class="content">


<div class="headline"><h2>New blog design and infrastructure</h2></div>
<div class="headline"><h2>Testing markdown</h2></div>
<div class="meta">
<div class="datetime">2012-1-12 </div>
<div class="datetime">2012-1-19 </div>
</div>
<div class="post_body">

<p> A brand new year and a brand new blog design.</p>
<p>This is a paragraph</p><div class="codeblock">
<pre class="prettyprint">

vim ~/.ssh/config

<p>This blog is now a static site, powered by a custom static blog generator I wrote in Python called <a href="https://github.com/jasonbartz/frozn" target="_blank">Frozn</a></p>

<p>It's a work in progress, but I wanted to get it out there for the beginning part of the new year.</p>

<p>I've included one technical post from my old blog, which will soon be available at the archives when they are live, but for now, enjoy the design and the code.</p>

<p>Design powered by <a target="_blank" href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a>.</p>

<p>Blog powered by <a href="https://github.com/jasonbartz/frozn" target="_blank">Frozn</a> and <a target="_blank" href="http://jinja.pocoo.org/docs/">Jinja2</a></p>

</pre>
</div>
<p>Here is another.</p>
<p>And one more paragraph.</p>
<ul>
<li>bullets</li>
<li>boom</li>
</ul>

</div>



</div>
</div>
</body>
Expand Down
58 changes: 23 additions & 35 deletions frozn/builder/extensions.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,40 @@
from jinja2 import nodes
from jinja2.ext import Extension

# class CodeBlock(Extension):
# # a set of names that trigger the extension.
# tags = set(['codeblock'])
#
# def __init__(self, environment):
# super(CodeBlock, self).__init__(environment)
#
# def parse(self, parser):
# # the first token is the token that started the tag. In our case
# # we only listen to ``'cache'`` so this will be a name token with
# # `cache` as value. We get the line number so that we can give
# # that line number to the nodes we create by hand.
# lineno = parser.stream.next().lineno
#
#
# # now we parse the body of the cache block up to `endcache` and
# # drop the needle (which would always be `endcache` in that case)
# body = parser.parse_statements(['name:endcodeblock'], drop_needle=True)
#
# body[0].nodes[0].data
#
# codeblock_string = '''<div class="codeblock">
# <pre class="prettyprint">
# %s
# </pre>
# </div>
# ''' % body[0].nodes[0].data
# body[0].nodes[0].data = codeblock_string
#
# # now return a `CallBlock` node that calls our _cache_support
# # helper method on this extension.
# return nodes.Block('codeblock',body,[]).set_lineno(lineno)
import markdown

class CodeBlock(Extension):
tags = set(['codeblock'])

def parse(self, parser):
node = nodes.Scope(lineno=next(parser.stream).lineno)
node.body = parser.parse_statements(('name:endcodeblock',),drop_needle=True)
#import pdb;pdb.set_trace()
codeblock_string = '''<div class="codeblock">
<pre class="prettyprint">
%s
</pre>
</div>
</div>
''' % node.body[0].nodes[0].data
node.body[0].nodes[0].data = codeblock_string

return node

class MarkDown(Extension):
tags = set(['markdown'])

def parse(self, parser):
node = nodes.Scope(lineno=next(parser.stream).lineno)
# Set the node body
node.body = parser.parse_statements(('name:markdown',), drop_needle=True)

# Loop through the body, ignoring CodeBlocks
# Transform the body into Markdown
for body_object in node.body:
# Conform body to markdown
try:
body_object.nodes[0].data = markdown.markdown(body_object.nodes[0].data)

# Other scope objects, like CodeBlock, will trigger this exception
except AttributeError:
pass

return node
Loading

0 comments on commit 59cb96f

Please sign in to comment.