Skip to content

owncloud-archive/owncloud-documentation-sitemap-builder

Repository files navigation

ownCloud Documentation Sitemap Builder

This is a simple project to build a valid sitemap.xml string from the files in the documentation repository.

Build Status Coverage Status Scrutinizer Code Quality Latest Version Total Downloads

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

require_once ('vendor/autoload.php');

$builder = new OwnCloud\SiteMapBuilder\SitemapBuilder();

$builder->generateSiteMapXml(
    $builder->getSitemapUrlList(
        realpath('../documentation/'), 
        'rst'
    )
);

Contributing

See the CONTRIBUTING file.

About

A package for building the ownCloud documentation sitemap.xml file

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages