Improve blog

This commit is contained in:
Danang Probo Sayekti 2015-08-01 01:32:34 +07:00
commit a99b71ef07
2 changed files with 6 additions and 3 deletions

View file

@ -10,6 +10,9 @@ blog.tagline = "Just another HTMLy blog"
blog.description = "Proudly powered by HTMLy, a databaseless blogging platform." blog.description = "Proudly powered by HTMLy, a databaseless blogging platform."
blog.copyright = "(c) Your name." blog.copyright = "(c) Your name."
; Show the /blog url as the blog homepage
blog.enable = "false"
; Social account ; Social account
social.twitter = "https://twitter.com" social.twitter = "https://twitter.com"
social.facebook = "https://www.facebook.com" social.facebook = "https://www.facebook.com"

View file

@ -1477,12 +1477,12 @@ function generate_rss($posts)
if (!empty($rssLength)) { if (!empty($rssLength)) {
if (strlen(strip_tags($p->body)) < config('rss.char')) { if (strlen(strip_tags($p->body)) < config('rss.char')) {
$string = preg_replace('/\s\s+/', ' ', strip_tags($p->body)); $string = preg_replace('/\s\s+/', ' ', strip_tags($p->body));
$body = $string . '...' . ' <a class="readmore" href="' . $p->url . '">more</a>'; $body = $string . '...';
} else { } else {
$string = preg_replace('/\s\s+/', ' ', strip_tags($p->body)); $string = preg_replace('/\s\s+/', ' ', strip_tags($p->body));
$string = substr($string, 0, config('rss.char')); $string = substr($string, 0, config('rss.char'));
$string = substr($string, 0, strrpos($string, ' ')); $string = substr($string, 0, strrpos($string, ' '));
$body = $string . '...' . ' <a class="readmore" href="' . $p->url . '">more</a>'; $body = $string . '...';
} }
} else { } else {
$body = $p->body; $body = $p->body;
@ -1795,7 +1795,7 @@ function Zip($source, $destination, $include_dir = false)
function is_index() function is_index()
{ {
$req = $_SERVER['REQUEST_URI']; $req = $_SERVER['REQUEST_URI'];
if (strpos($req, '/archive/') !== false || strpos($req, '/tag/') !== false || strpos($req, '/search/') !== false || $req == site_path() . '/' || strpos($req, site_path() . '/?page') !== false) { if (strpos($req, '/archive/') !== false || strpos($req, '/tag/') !== false || strpos($req, '/search/') !== false || strpos($req, '/blog') !== false || $req == site_path() . '/' || strpos($req, site_path() . '/?page') !== false) {
return true; return true;
} else { } else {
return false; return false;