ArachnidSitemapBundle
Symfony2 bundle that help you generate sitemap.xml via traversing internal site urls dynamically., (*1)
This bundle uses Arachnid Web Crawler to extract site urls and use them to build sitemap.xml file., (*2)
How to Install
You can install this bundle via composer. Add the following to the "require" section of composer.json:, (*3)
"zrashwani/arachnid-sitemap-bundle": "1.*"
then run composer update
, (*4)
Adding the bundle to your kernel
To enable the sitemap bundle, add it to your kernel registerBundles() method:, (*5)
use Symfony\Foundation\Kernel;
class MyKernel extends Kernel {
// ...
public function registerBundles() {
return array(
// ...
new Zrashwani\ArachnidSitemapBundle\ZrashwaniArachnidSitemapBundle(),
// ...
);
}
}
Running sitemap generation command
The sitemap generation is implemented as symfony2 command that can be called as following:, (*6)
php app/console arachnid:sitemap:generate http://your-base-url.com/, (*7)
Optional parameters can be used to add simple customization on sitemap.xml contents and crawler behaviour
* use --links_depth
to determine to which links level the crawler will operate, default: 3
* use --sitemap_path
to determine full path of sitemap file to write, default: /path-to-web-directory/sitemap.xml
* use --frequency
to specify default for all links, (*8)
make sure your sitemap_path
is writable to your web server so the command can place sitemap contents correctly., (*9)
How to Contribute
- Fork this repository
- Create a new branch for each feature or improvement
- Send a pull request from each feature branch
It is very important to separate new features or improvements into separate feature branches,
and to send a pull request for each branch. This allows me to review and pull in new features
or improvements individually., (*10)
All pull requests must adhere to the PSR-2 standard., (*11)