zrashwani / arachnid-sitemap-bundle
sitemap generator bundle for Symfony2 via traversing website internal links
Installs: 137
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.0
- codeguy/arachnid: 1.*
- symfony/framework-bundle: ~2.1
Requires (Dev)
- phpunit/phpunit: ~3.7
- symfony/console: ~2.5
- symfony/symfony: ~2.3
This package is not auto-updated.
Last update: 2022-02-01 12:39:48 UTC
README
Symfony2 bundle that help you generate sitemap.xml via traversing internal site urls dynamically.
This bundle uses Arachnid Web Crawler to extract site urls and use them to build sitemap.xml file.
How to Install
You can install this bundle via composer. Add the following to the "require" section of composer.json:
"zrashwani/arachnid-sitemap-bundle": "1.*"
then run composer update
Adding the bundle to your kernel
To enable the sitemap bundle, add it to your kernel registerBundles() method:
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:
php app/console arachnid:sitemap:generate http://your-base-url.com/
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
make sure your sitemap_path
is writable to your web server so the command can place sitemap contents correctly.
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.
All pull requests must adhere to the PSR-2 standard.