Download the PHP package apertagraffa/sitemapper without Composer
On this page you can find all versions of the php package apertagraffa/sitemapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download apertagraffa/sitemapper
More information about apertagraffa/sitemapper
Files in apertagraffa/sitemapper
Package sitemapper
Short Description Ridiculously small package for manual sitemap generation in small websites
License MIT
Homepage https://github.com/lucamenozzi/sitemapper
Informations about the package sitemapper
Manual sitemap generator
Laravel 5.2 Package to generate hand-write sitemap (only for small websites)
Synopsis
Sitemapper create a static sitemap in real time when requested via /sitemap.xml URI.
Obviously, this package is for small website only: if you have 100 pages, this strategy is wrong.
But for your personal website or for your blog, maybe you could give it a chance.
Installation
- add "apertagraffa/sitemapper": "*" to your composer.json
- create a get route to sitemap.xml: you can both use a callback in the route, but the best approach is to connect a controller method (to SitemapController, for example).
API Reference
You have only two methods, for now, you can't make mistakes :)
- $sitemap->addUrl($location, $lastmod = null, $changefreq = null, $priority = null) : add a node to xml sitemap tree. $location is the needed static url, other parameters are optional;
- $sitemap->render(): create the final sitemap tree.
You can then
Behaviour
The real time response works only if NOT EXISTS a physical sitemap.xml file in root. If it exists, will be returned.
That's all folks!