1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-08 06:06:53 +02:00

Site Url without trailing slashes

This commit is contained in:
Евгений
2014-01-07 01:02:23 +06:00
parent 432942abf8
commit 3d83dc775f
15 changed files with 27 additions and 27 deletions

View File

@@ -82,7 +82,7 @@ class Sitemap extends Frontend
$map .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\n";
foreach ($pages_list as $page) {
if ($page['parent'] != '') { $parent = $page['parent'].'/'; $priority = '0.5'; } else { $parent = ''; $priority = '1.0'; }
$map .= "\t".'<url>'."\n\t\t".'<loc>'.Option::get('siteurl').$parent.$page['slug'].'</loc>'."\n\t\t".'<lastmod>'.date("Y-m-d", (int) $page['date']).'</lastmod>'."\n\t\t".'<changefreq>weekly</changefreq>'."\n\t\t".'<priority>'.$priority.'</priority>'."\n\t".'</url>'."\n";
$map .= "\t".'<url>'."\n\t\t".'<loc>'.Option::get('siteurl').'/'.$parent.$page['slug'].'</loc>'."\n\t\t".'<lastmod>'.date("Y-m-d", (int) $page['date']).'</lastmod>'."\n\t\t".'<changefreq>weekly</changefreq>'."\n\t\t".'<priority>'.$priority.'</priority>'."\n\t".'</url>'."\n";
}
// Get list of components
@@ -91,7 +91,7 @@ class Sitemap extends Frontend
// Add components to sitemap
if (count($components) > 0) {
foreach ($components as $component) {
$map .= "\t".'<url>'."\n\t\t".'<loc>'.Option::get('siteurl').Text::lowercase($component).'</loc>'."\n\t\t".'<lastmod>'.date("Y-m-d", time()).'</lastmod>'."\n\t\t".'<changefreq>weekly</changefreq>'."\n\t\t".'<priority>1.0</priority>'."\n\t".'</url>'."\n";
$map .= "\t".'<url>'."\n\t\t".'<loc>'.Option::get('siteurl').'/'.Text::lowercase($component).'</loc>'."\n\t\t".'<lastmod>'.date("Y-m-d", time()).'</lastmod>'."\n\t\t".'<changefreq>weekly</changefreq>'."\n\t\t".'<priority>1.0</priority>'."\n\t".'</url>'."\n";
}
}

View File

@@ -9,7 +9,7 @@
foreach ($pages_list as $page) {
if (trim($page['parent']) !== '') $parent = $page['parent'].'/'; else $parent = '';
if (trim($page['parent']) !== '') { echo '<ul>'."\n"; }
echo '<li><a href="'.Option::get('siteurl').$parent.$page['slug'].'">'.$page['title'].'</a></li>'."\n";
echo '<li><a href="'.Option::get('siteurl').'/'.$parent.$page['slug'].'">'.$page['title'].'</a></li>'."\n";
if (trim($page['parent']) !== '') { echo '</ul>'."\n"; }
}
if (count($components) == 0) { echo '<ul>'."\n"; }
@@ -21,7 +21,7 @@
if (count($components) > 0) {
if (count($pages_list) == 0) { echo '<ul>'."\n"; }
foreach ($components as $component) {
echo '<li><a href="'.Option::get('siteurl').$component.'">'.__(ucfirst($component), $component).'</a></li>'."\n";
echo '<li><a href="'.Option::get('siteurl').'/'.$component.'">'.__(ucfirst($component), $component).'</a></li>'."\n";
}
if (count($pages_list) == 0) { echo '</ul>'."\n"; }
}