Skip to content
Permalink
Browse files

Rewrite documentation (#158)

* Rewrite documentation

* Fixed typo in README

* Documentation review

* Fixed some typos (#159)
  • Loading branch information...
yann-eugone committed Feb 20, 2018
1 parent 3b82986 commit 16a2c0eae7320e3647013e48026a6a6bd14f75df
165 README.md
@@ -5,166 +5,57 @@
[![Latest Stable Version](https://poser.pugx.org/presta/sitemap-bundle/v/stable.png)](https://packagist.org/packages/presta/sitemap-bundle)
[![Total Downloads](https://poser.pugx.org/presta/sitemap-bundle/downloads.png)](https://packagist.org/packages/presta/sitemap-bundle)

[![PrestaSitemapBundle on Knpbundles](http://knpbundles.com/prestaconcept/PrestaSitemapBundle/badge)](http://knpbundles.com/prestaconcept/PrestaSitemapBundle)

PrestaSitemapBundle is a Symfony XML sitemap generator.

PrestaSitemapBundle is a Symfony2 xml sitemap generator.

## Overview

:speech_balloon: If you want to have some informations about the projet progression you can register to our [google group][10]

A sandbox is available in a dedicated [GitHub repository](https://github.com/yann-eugone/presta-sitemap-test-project).

## Overview
You may also have a look to [Prestaconcept's website sitemap](https://www.prestaconcept.net/sitemap.xml)
(which is built with this bundle).

For a ready to use demonstration of PrestaSitemap you should check the [prestacms-sandox available on github][11].

Sandbox is also deployed for a live demonstration :
## Versions

- [Sitemap index][12]
- [Sitemap section][13]
This bundle is compatible with all Symfony versions since `2.3.0`.

## Requirements
However, like Symfony, we do not provide support for Symfony's version that reached EOL.

* See also the `require` section of [composer.json](composer.json)

## Features ##
## Features

* Sitemapindex
* Google images, video, mobile and multilang urls
* Respect constraints (50k items / 10mB per files)
* Respect constraints (50k items / 10MB per file)
* No database required
* Optionnal caching (using DoctrineCacheBundle, disabled by default)

## TL;DR

1. Installation

```sh
composer require presta/sitemap-bundle
```

```php
//app/AppKernel.php
public function registerBundles()
{
$bundles = array(
//...
new Presta\SitemapBundle\PrestaSitemapBundle(),
);
}
```

```yaml
#app/config/routing.yml
PrestaSitemapBundle:
resource: "@PrestaSitemapBundle/Resources/config/routing.yml"
prefix: /
```

2. Usage

For static url there's annotation support in your routes :

```php
/**
* @Route("/", name="homepage", options={"sitemap" = true})
*/
```

Or YAML support:

```php
homepage:
path: /
defaults: { _controller: "AppBundle:Default:index" }
options:
sitemap: true
```

Or XML support:

```xml
<route id="homepage" path="/">
<default key="_controller">AppBundle:Default:index</default>
<option key="sitemap">true</option>
</route>
```

For complexe routes, create a [Closure][3] or a [Service][5] dedicated to your sitemap then add your urls :

```php
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
// ...
function(SitemapPopulateEvent $event) use ($router){
//get absolute homepage url
$url = $router->generate('homepage', array(), UrlGeneratorInterface::ABSOLUTE_URL);
//add homepage url to the urlset named default
$event->getUrlContainer()->addUrl(
new UrlConcrete(
$url,
new \DateTime(),
UrlConcrete::CHANGEFREQ_HOURLY,
1
),
'default'
);
}
```

3. Decorated url (images, videos, etc.)

The [doc][6] is already really short ;)

## Documentation ##

You will find the detailed documentation in the following links :

* [1-Installation.md][1]
* [2-Configuration.md][2]
* [3-Usage-Quick_and_dirty.md][3]
* [4-Usage-Routing_Config.md][4]
* [5-Usage-Event_Listener.md][5]
* [6-Url_Decorator.md][6]
* [7-Dumper_command.md][7]
* [CHANGELOG.md][8]
* [CONTRIBUTORS.md][9]

## Ask for help ##

:speech_balloon: If you need help about this project you can [post a message on our google group][10]
* Optional caching (using `DoctrineCacheBundle`)

## Contributing

Pull requests are welcome.

Thanks to
[everyone who has contributed](https://github.com/prestaconcept/PrestaSitemapBundle/graphs/contributors) already.
## Documentation

---
You will find the detailed documentation in the following links:

*This project is supported by [PrestaConcept](http://www.prestaconcept.net)*
* [Installation](Resources/doc/1-installation.md)
* [Configuration](Resources/doc/2-configuration.md)
* [Static routes usage](Resources/doc/3-static-routes-usage.md)
* [Dynamic routes usage](Resources/doc/4-dynamic-routes-usage.md)
* [Decorating URLs](Resources/doc/5-decorating-urls.md)
* [Dumping sitemap](Resources/doc/6-dumping-sitemap.md)

**Lead Developer** : [@nicolas-bastien](https://github.com/nicolas-bastien)

Released under the MIT License
## Contributing

[1]: Resources/doc/1-Installation.md
[2]: Resources/doc/2-Configuration.md
[3]: Resources/doc/3-Usage-Quick_and_dirty.md
[4]: Resources/doc/4-Usage-Routing_Config.md
[5]: Resources/doc/5-Usage-Event_Listener.md
[6]: Resources/doc/6-Url_Decorator.md
[7]: Resources/doc/7-Dumper_command.md
[8]: CHANGELOG.md
[9]: Resources/doc/CONTRIBUTORS.md
Please feel free to open an [issue](https://github.com/prestaconcept/PrestaSitemapBundle/issues)
or a [pull request](https://github.com/prestaconcept/PrestaSitemapBundle),
if you want to help.

[10]: https://groups.google.com/forum/?hl=fr&fromgroups#!forum/prestacms-devs
[11]: https://github.com/prestaconcept/prestacms-sandbox
[12]: http://sandbox.prestacms.fr/sitemap.xml
[13]: http://sandbox.prestacms.fr/sitemap.sandbox.xml
Thanks to
[everyone who has contributed](https://github.com/prestaconcept/PrestaSitemapBundle/graphs/contributors) already.

---

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/prestaconcept/prestasitemapbundle/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
*This project is supported by [PrestaConcept](http://www.prestaconcept.net)*

Released under the [MIT License](LICENSE)

This file was deleted.

@@ -0,0 +1,55 @@
# Bundle installation

Require the bundle as a dependency.

```bash
$ composer require presta/sitemap-bundle
```

Enable it in your application Kernel.

```php
<?php
// config/bundles.php
return [
//...
Presta\SitemapBundle\PrestaSitemapBundle::class => ['all' => true],
];
```

Or in your legacy application.

```php
<?php
// app/AppKernel.php
class AppKernel
{
public function registerBundles()
{
$bundles = [
//...
new Presta\SitemapBundle\PrestaSitemapBundle(),
];
//...
return $bundles;
}
}
```

Import routing.

```yaml
#config/routes/presta_sitemap.yml
presta_sitemap:
resource: "@PrestaSitemapBundle/Resources/config/routing.yml"
```

> **Note** you may not be required to import routing if you would only rely on dumped sitemaps.
> Jump to [dedicated documentation](7-dump-sitemap.md) for more information.

---

« [README](../../README.md) • [Configuration](2-configuration.md) »

This file was deleted.

0 comments on commit 16a2c0e

Please sign in to comment.
You can’t perform that action at this time.