Skip to content

Instantly share code, notes, and snippets.

View navilan's full-sized avatar

Navilan navilan

View GitHub Profile
@navilan
navilan / ie6.itsobsolete.js
Created January 27, 2009 07:04
Includes for ie6.itsobsolete.com
if((navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) &&
(navigator.userAgent.toLowerCase().indexOf('msie 7') == -1)){
if( !document.referrer ||
(document.referrer.indexOf(document.location.hostname) === -1 &&
document.referrer.indexOf("itsobsolete") === -1)){
document.location.href =
"http://ie6.itsobsolete.com?title=Ringce&url=" +
escape(document.location.href);
}
}
@navilan
navilan / hyde_page_listing.html
Created March 2, 2009 16:08
Sample code for listing a set of pages that belong to a node.
{% for node in page.node.walk %}
<ul>
{% for list_page in node.pages %}
{% if list_page.display_in_list %}
<li>
<h1><a href="{{list_page.url}}">{{list_page.title}}</a></h1>
{% if page.excerpt %}
<div class="page-excerpt">
{% render_excerpt list_page %}
</div>
<ul>
<li{% ifequal page.module site.module %} class="selected" {% endifequal %}>
<a href="{{site.listing_url}}">Home</a>
</li>
{% for module in site.children %}
<li{% ifequal page.module module %} class="selected" {% endifequal %}>
<a href="{{module.listing_url}}">
{{module.name|unslugify}}
</a>
</li>
<ul class="breadcrumbs">
{% for node in page.node.ancestors %}
<li>
<a href="{{node.listing_url}}">{{node.name|unslugify}}</a>
{% if not forloop.last%}<span class="separator">&gt;</span>{% endif %}
</li>
{% endfor %}
</ul>
<a {%if page.next%} href="{{page.next.url}}"{%endif%}>Previous</a>
<a {%if page.prev%} href="{{page.prev.url}}"{%endif%}>Next</a>
<div id="excerpt">
{% latest_excerpt "{{site.folder.path}}/blog" %}
</div>
<div id="excerpt-footer">
Read More: <a href="{{latest_excerpt_url}}">{{latest_excerpt_title}}</a>
</div>
<?xml version="1.0" encoding="utf-8"?>
{%spaceless%}
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{site.name}} {{page.node.name}}</title>
<link href="{{page.node.full_url}}/atom.xml" rel="self"/>
<link href="{{site.full_url}}"/>
<updated>{{now|xmldatetime}}</updated>
<id>{{site.full_url}}</id>
{% for node_page in page.node.walk_pages %}
{% if node_page.display_in_list %}
{%recent_posts recents 5 %}
<ul>
{%for post in recents %}
<li>
<a href='{{post.url}}'>{{post.title}}</a>
</li>
{%endfor%}
</ul>
@navilan
navilan / hyde_root_template_usage.html
Created January 9, 2010 11:17
Using the root template to exclude the hyde tag from rendered content
{%extends "skeleton/_root.html"%}
{%hyde
awesome: awesome1
%}
{%block all%}
{{page.awesome}}
lorem ipsum
{%endblock%}