Skip to content

Instantly share code, notes, and snippets.

@hjerpbakk
Created July 30, 2012 16:12
Show Gist options
  • Save hjerpbakk/3208100 to your computer and use it in GitHub Desktop.
Save hjerpbakk/3208100 to your computer and use it in GitHub Desktop.
<b:widget id='Blog55' locked='true' title='Blog Posts' type='Blog'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "item"'>
<b:loop values='data:posts' var='post'>
<script type='text/javascript'>
var timestamp = '<data:post.timestamp/>';
timestamp = timestamp.split('/');
timestamp = timestamp[2]+'/'+timestamp[0].replace(/^[0]+/g,"")+'/'+timestamp[1].replace(/^[0]+/g,"")+'/';
var permalink = '<data:post.url/>';
var linkParts = permalink.split('/');
var pageName = linkParts[5];
if (pageName == "saving-configuration-in-c.html")
{
pageName = "saving-a-configuration-in-c.html";
}
var newURL ="http://hjerpbakk.com/blog/" + timestamp + pageName;
document.location.href = newURL;
</script>
</b:loop>
</b:if>
</b:includable>
</b:widget>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment