-
-
Save parzibyte/3e6116b59d587556aedb70bceeeff3c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Generar un sitemap con PHP y Sitemap.php | |
* | |
* @author parzibyte | |
*/ | |
# Incluye clase, o autoloader | |
include_once "Sitemap.php"; | |
# Indica que vas a usar el namespace | |
use SitemapPHP\Sitemap; | |
# Crear sitemap | |
$sitemap = new Sitemap("https://parzibyte.me"); | |
# Agrega todas las URL | |
$sitemap->addItem("/", "1.0", "yearly", "Today"); | |
$sitemap->addItem("/blog", "0.9", "daily", "Today"); | |
$sitemap->addItem("/apps/cotizaciones", "0.9", "daily", "Today"); | |
# Genera el sitemap | |
$sitemap->createSitemapIndex("https://parzibyte.me/", "Today"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
<sitemap> | |
<loc>https://parzibyte.me/sitemap.xml</loc> | |
<lastmod>2019-03-23</lastmod> | |
</sitemap> | |
</sitemapindex> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
<url> | |
<loc>https://parzibyte.me/</loc> | |
<priority>1.0</priority> | |
<changefreq>yearly</changefreq> | |
<lastmod>2019-03-23</lastmod> | |
</url> | |
<url> | |
<loc>https://parzibyte.me/blog</loc> | |
<priority>0.9</priority> | |
<changefreq>daily</changefreq> | |
<lastmod>2019-03-23</lastmod> | |
</url> | |
</urlset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment