Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: 40bcfc4955
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (73 sloc) 4.032 kB
layout: master
title: Blog
<a href='' class='float-right'><img src='/images/subscribe.png' alt='Subscribe to XML Feed'/></a>
<h2>Blog Post Search With <a href="/2009/03/26/what-are-machine-tags.html">Machine Tags</a></h2>
{% include tag_tree.html %}
<input value="All Posts" type="button" onclick="javascript:$('#tag_tree').html('');$('#all_posts').show()" />
<input value="Toggle Machine Tag Help" type="button" onclick="javascript:$('#machine_tag_help').toggle();void(0)" />
<div style="display:none" id="machine_tag_help">
You can search these posts with a wildcard machine tag. For example, <a class='machine_tag_href_search' href="#post:*">post:*</a> returns all machine tags that have post as its namespace while <a class='machine_tag_href_search' href="#post:type=*">post:type=*</a> returns all machine tags that have post as its namespace and type as its predicate. Search results are displayed as machine tag branches with each branch containing all posts that have that particular machine tag. A machine tag branch is organized by namespace, predicate and value. For example, the <a class='machine_tag_href_search' href='#post:lang=ruby'>post:lang=ruby</a> branch's ancestry is <code>post(namespace) > lang(predicate) > ruby(value)</code>.<br/>
So why display posts with machine tag trees? Because I can you give an endless number of ways to view my blog posts. For starters: <a class='machine_tag_href_search' href="#post:lang=*">Blog posts by programming language</a>, <a class='machine_tag_href_search' href="#post:type=*">posts by post type</a>, <a class='machine_tag_href_search' href='#gem:name=*'>posts about specific ruby gems</a>, and <a class='machine_tag_href_search' href='#lib:name=*'>posts about specific core/standard ruby libraries</a>.
<div id="tag_tree"></div>
<script type="text/javascript" charset="utf-8">
$(function() {
$("a.machine_tag_href_search").click(function() { $.machineTagSearch(this.href.match(/#(.*?)$/).pop());});
$("a.machine_tag_search").click(function() { $.machineTagSearch($(this).text());});
$.machineTagTree.defaultOptions = {recordName: 'Posts'};
$.machineTagSearch.defaultOptions = {
jsonUrl: '/feeds/posts.json', beforeSearch: toggleSpinner, afterSearch: toggleSpinner,
displayCallback: function(wildcard_machine_tag, records, options) {
$.machineTagTree(wildcard_machine_tag, records, options); $('#all_posts').hide();}
<div id="all_posts">
<caption>All Posts</caption>
<th>Tags / <a href='javascript:void($.toggleHiddenMachineTags())'>Machine Tags</a></th>
<th width='90'>Comments</th>
{% for post in site.posts %}
<a style="line-height:125%" href='{{ post.url }}'>{{ post.title }}</a>
<a href='javascript:void($("#description_{{forloop.index}}").toggle())'>*description*</a>
<div id="description_{{forloop.index}}" class='table_post_description'>
{% if post.description %}{{post.description}}{% else %}No description.{% endif %}
<td><div class='record_tags_column'>{% include tag_links.html%}</div></td>
<td>{{ | date_to_string }}</td>
<td><a href='{{post.url}}#disqus_thread'>Comments</a></td>
{% endfor %}
<div style="font-size: 12px; color: #0E51A7">Yes, the dates on those last posts are correct. They were ported over from my old domain,</div>
{% comment %}
{% for post in site.posts %}
{% if forloop.index < page.full_posts %}
<div class='post'>
<span class='date'>{{ | date_to_string}}</span>
<h1><a href='{{post.url}}'>{{post.title}}</a></h1>
<div class='body'>{{post.content}}</div>
<a href='{{post.url}}#disqus_thread'>View Comments</a>
{% endif %}
{% endfor %}
{% endcomment %}
Jump to Line
Something went wrong with that request. Please try again.