diff --git a/robots.txt b/robots.txt index bd761f4..6534f66 100644 --- a/robots.txt +++ b/robots.txt @@ -29,6 +29,4 @@ Disallow: /composer.json Disallow: /composer.lock Disallow: /composer.phar # Paths -Disallow: /search/ - -Sitemap: /feed/sitemap \ No newline at end of file +Disallow: /search/ \ No newline at end of file diff --git a/system/config.ini b/system/config.ini index 57f6d67..6b58432 100644 --- a/system/config.ini +++ b/system/config.ini @@ -33,8 +33,8 @@ posts.perpage = "5" tag.perpage = "10" archive.perpage = "10" search.perpage = "10" -profile.perpage = "30" -rss.count = "30" +profile.perpage = "10" +rss.count = "10" json.count = "10" ; Related posts diff --git a/system/htmly.php b/system/htmly.php index 6c6f65f..adb50fd 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -203,6 +203,32 @@ get('/search/:keyword', function($keyword){ // The static page get('/:static', function($static){ + if($static === 'sitemap.xml' || $static === 'sitemap.base.xml' || $static === 'sitemap.post.xml' || $static === 'sitemap.static.xml' || $static === 'sitemap.tag.xml' || $static === 'sitemap.archive.xml') { + + header('Content-Type: text/xml'); + + if ($static === 'sitemap.xml') { + generate_sitemap('index'); + } + else if ($static === 'sitemap.base.xml') { + generate_sitemap('base'); + } + else if ($static === 'sitemap.post.xml') { + generate_sitemap('post'); + } + else if ($static === 'sitemap.static.xml') { + generate_sitemap('static'); + } + else if ($static === 'sitemap.tag.xml') { + generate_sitemap('tag'); + } + else if ($static === 'sitemap.archive.xml') { + generate_sitemap('archive'); + } + + die; + } + $post = get_static_post($static); if(!$post){ @@ -279,15 +305,6 @@ get('/feed/rss',function(){ echo generate_rss(get_posts(null, 1, config('rss.count'))); }); -// Show the RSS feed for sitemap -get('/feed/sitemap',function(){ - - header('Content-Type: application/rss+xml'); - - // Generate RSS feed for all blog posts - echo generate_sitemap(get_posts(null, null, null)); -}); - // Generate OPML file get('/feed/opml',function(){ diff --git a/system/includes/functions.php b/system/includes/functions.php index a63c43e..6907316 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -504,7 +504,7 @@ function archive_list() { echo '