forked from mbleigh/mbleigh.github.com
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathblog.html
79 lines (73 loc) · 3.94 KB
/
blog.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
layout: master
title: Blog
---
<a href='http://feeds2.feedburner.com/tagaholic' 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">
<p>
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>.
</p>
</div>
<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").hideMachineTags();
$("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();}
};
$.machineTagSearchLocation();
});
</script>
<div id="all_posts">
<table>
<caption>All Posts</caption>
<thead>
<tr>
<th>Posts</th>
<th>Tags / <a href='javascript:void($.toggleHiddenMachineTags())'>Machine Tags</a></th>
<th>Date</th>
<th width='90'>Comments</th>
</tr>
</thead>
<tbody>
{% for post in site.posts %}
<tr>
<td>
<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 %}
</div>
</td>
<td><div class='record_tags_column'>{% include tag_links.html%}</div></td>
<td>{{ post.date | date_to_string }}</td>
<td><a href='{{post.url}}#disqus_thread'>Comments</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<p/>
<div style="font-size: 12px; color: #0E51A7">Yes, the dates on those last posts are correct. They were ported over from my old domain, chwhat.com</div>
</div>
{% comment %}
{% for post in site.posts %}
{% if forloop.index < page.full_posts %}
<div class='post'>
<span class='date'>{{post.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>
</div>
{% endif %}
{% endfor %}
{% endcomment %}