This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function truncate(elem, size){ | |
var text = elem.text(), mid = Math.round(text.length/2), i = 0; | |
while(elem.width() > size){ | |
i++; | |
var newText = text.substr(0,mid-1*i)+'…'+text.substr(mid+1*i, text.length); | |
elem.text(newText); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// get any list of items | |
// in this case we get all visible children of the blog section, | |
// flip them to get them in reverse order and make sure we only get the last 10 | |
$items = $pages->find($page->podcast())->children()->visible()->flip()->limit(25); | |
$podcast = $pages->find($page->podcast()); | |
// defaults | |
if(!isset($descriptionExcerpt)) $descriptionExcerpt = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-type: text/xml; charset="utf-8"'); | |
echo '<?xml version="1.0" encoding="utf-8"?>'; | |
?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
<?php foreach($pages->index() as $p): ?> | |
<?php if($p->isVisible()): ?> |