How to blog using Telegram

Telegram is a nifty way for you to blog based on files in your Dropbox or hosted on GitHub. This means you can blog from anywhere on any device. Simple.

If you put a file in the _posts directory, the file will be considered a blog post.

You can add extra info to the page to define information about the post:

[title: How to blog]: /
[category: Tech]: /
[date: 2012/06/20]: /
[tags: {blog, tech}]: /


You can list blog posts by including the following HTML on any page:

<ul class="posts" style="list-style: none" data-lift="blog.posts?max=15">
    <li data-post="item"><h2><a data-post="link" href="#">Blog Post</a></h2>
    	<h4 style="padding-left: 8px;"><span data-post="date">2012/12/14</span></h4>
    	<div style="padding-left: 15px;" data-post="shortcontent">Post Content goes here</div>
	    <div data-post="more"><a href="#">Read More...</a></div>


On a separate note, you can apply a transformation to every page on your site. After Telegram renders the page, but before it writes the HTML, Telegram does a final set of page transformations. If you are using a Telegram template, put a files named include.html in the templates-hidden directory. This file will be included in every page on your site.

Within the file, you can include snippets, for example:

	<span data-lift="xform" data-css="footer *">This is my blog (c) 2012 by me</span>

The page must be a single HTML element, so the outer <div> is discarded.

The <span> contains a snippet invocation. The xform snippet takes the value of the data-css attribute and treats it as a CSS Selector Transform. The element itself (the <span> element) will be substituted for all matching HTML elements. In this case, the <span> element is placed inside all <footer> tags. The result is that the footer on every page is set to <span>This is my blog (c) 2012 by me</span>.