From 04e6d5f0430aca38d8a15586a19a83307fe54a6f Mon Sep 17 00:00:00 2001 From: Simon Asika Date: Sun, 7 Jun 2015 23:26:31 +0800 Subject: [PATCH] MISC update --- README.md | 15 +++++++++++---- src/Sitemap.php | 8 ++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 469aeee..ffe3283 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,10 @@ You can add some optional params. use Asika\Sitemap\ChangeFreq; $sitemap->addItem($url, '1.0', ChangeFreq::DAILY, '2015-06-07 10:51:20'); +$sitemap->addItem($url, '0.7', ChangeFreq::WEEKLY, new \DateTime('2015-06-03 11:24:20')); ``` -The first arguments are `loc`, `priority`, `changefreq` and `lastmod`. See this table: +The arguments are `loc`, `priority`, `changefreq` and `lastmod`. See this table: | Params | Required | Description | | ------ | -------- | ----------- | @@ -51,7 +52,7 @@ The first arguments are `loc`, `priority`, `changefreq` and `lastmod`. See this See: http://www.sitemaps.org/protocol.html#xmlTagDefinitions -Then we render it to XML: +### Render it to XML: ``` php echo $sitemap->toString(); @@ -116,8 +117,14 @@ ChangeFreq::YEARLY; ChangeFreq::NEVER; ``` -The value "always" should be used to describe documents that change each time they are accessed. The value "never" should be used to describe archived URLs. -Please note that the value of this tag is considered a hint and not a command. Even though search engine crawlers may consider this information when making decisions, they may crawl pages marked "hourly" less frequently than that, and they may crawl pages marked "yearly" more frequently than that. Crawlers may periodically crawl pages marked "never" so that they can handle unexpected changes to those pages. +The value `always` should be used to describe documents that change each time they are accessed. + +The value `never` should be used to describe archived URLs. + +Please note that the value of this tag is considered a hint and not a command. Even though search engine crawlers may consider this information when making decisions, +they may crawl pages marked `hourly` less frequently than that, and they may crawl pages marked `yearly` more frequently than that. + +Crawlers may periodically crawl pages marked `never` so that they can handle unexpected changes to those pages. ### priority diff --git a/src/Sitemap.php b/src/Sitemap.php index 3f7071b..11f467b 100644 --- a/src/Sitemap.php +++ b/src/Sitemap.php @@ -25,10 +25,10 @@ class Sitemap extends AbstractSitemap /** * addItem * - * @param string $loc - * @param string $priority - * @param string $changefreq - * @param string $lastmod + * @param string $loc + * @param string $priority + * @param string $changefreq + * @param string|\DateTime $lastmod * * @return static */