https://github.com/owncloud-archive/owncloud-documentation-sitemap-builder
A package for building the ownCloud documentation sitemap.xml file
https://github.com/owncloud-archive/owncloud-documentation-sitemap-builder
documentation sitemap-xml
Last synced: about 1 month ago
JSON representation
A package for building the ownCloud documentation sitemap.xml file
- Host: GitHub
- URL: https://github.com/owncloud-archive/owncloud-documentation-sitemap-builder
- Owner: owncloud-archive
- License: gpl-2.0
- Created: 2017-08-02T12:58:23.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-03T10:57:26.000Z (almost 9 years ago)
- Last Synced: 2024-03-26T17:09:55.776Z (over 2 years ago)
- Topics: documentation, sitemap-xml
- Language: PHP
- Size: 29.3 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ownCloud Documentation Sitemap Builder
This is a simple project to build a valid sitemap.xml string from the files in the documentation repository.
[](https://travis-ci.org/owncloud/owncloud-documentation-sitemap-builder)
[](https://coveralls.io/r/owncloud/owncloud-documentation-sitemap-builder?branch=master)
[](https://scrutinizer-ci.com/g/owncloud/owncloud-documentation-sitemap-builder/?branch=master)
[](https://packagist.org/packages/owncloud/owncloud-documentation-sitemap-builder)
[](https://packagist.org/packages/owncloud/owncloud-documentation-sitemap-builder)
## Why?
This project was created for a couple of reasons.
Firstly, to generate a valid sitemap.xml file for the documentation, and then to keep it up to date.
Maintaining software documentation isn't that simple.
And getting the right information (meaning the most up to date information) to appear in search results requires a valid and well-constructed sitemap.xml file.
To create and maintain one by hand for a project of this size isn't practical.
So this library was created to automate the process, whether once or with each merge to master.
## Installation
To install the package, run `composer require settermjd/owncloud-documentation-sitemap-builder`.
## Usage
Below is a sample of how to use the package.
It shows how to instantiate a new `SitemapBuilder` instance, which is constructed with the default ownCloud basePath and version settings.
On this instance:
1. A call to `getSitemapUrlList` is made. This converts the `.rst` files found under `../documentation` into a set of equivalent URLs.
2. The generated URLs list is then passed to `generateSiteMapXml`, which builds a sitemap.xml string from the supplied information.
```php
generateSiteMapXml(
$builder->getSitemapUrlList(
realpath('../documentation/'),
'rst'
)
);
````
## Contributing
See the [CONTRIBUTING](CONTRIBUTING.md) file.