From 2763f21c85e6937d517b23e020a3d9fa3c14a1af Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Fri, 9 Jul 2010 16:51:44 -0700 Subject: [PATCH] permalinks --- lib/data.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/data.php b/lib/data.php index 7d26c36..e20e402 100644 --- a/lib/data.php +++ b/lib/data.php @@ -113,9 +113,9 @@ function parse_entry($fileInfo, $page = 0) $file['timestamp'] = $file['config']['date'] ? date('U', strtotime( $file['config']['date'])) : $fileInfo->getCTime(); $file['tags'] = $file['config']['tags'] ? explode(" ", $file['config']['tags']) : null; $file['content'] = Markdown($content); - $file['cat'] = $page ? null : substr(clean_slashes(str_replace(LOCAL_ROOT . CONTENT_DIR, "", $fileInfo->getPath())),1); + $file['cat'] = $page? null : substr(clean_slashes(str_replace(LOCAL_ROOT . CONTENT_DIR, "", $fileInfo->getPath())),1); $file['path'] = $fileInfo->getRealPath(); - $file['url'] = WEB_ROOT . $file['cat'] . $fileInfo->getFilename(); + $file['url'] = WEB_ROOT . ($page ? '' : $file['cat'] . '/' ) . $fileInfo->getFilename(); return $file; } -- 2.34.1