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:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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"; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user