bootpress/sitemap

A sitemap generator that saves all of your links, tracks any updates, and makes the entire site searchable.

v1.1 2024-07-24 22:37 UTC

This package is not auto-updated.

Last update: 2024-11-14 00:14:25 UTC


README

Packagist License MIT HHVM Tested PHP 7 Supported Build Status Code Climate Test Coverage

The BootPress Sitemap Component generates the sitemap[...].xml files by saving all of your website's links, and keeping track of any updates. Any 404 pages are removed as they come to our attention (via $page->send(404)). It also has convenience methods for adding or removing multiple pages at once, and searching the entire site or any parts thereof. The only heads up is to watch what you Sitemap::add() to the database. Listing or product pages that have constantly changing or updated content are not good candidates for the sitemap. It will screw up your searches, and you only want Google to index real content pages anyways.

Installation

Add the following to your composer.json file.

{
    "require": {
        "bootpress/sitemap": "^1.0"
    }
}

Example Usage

<?php

use BootPress\Page\Component as Page;
use BootPress\Sitemap\Component as Sitemap;

$page = Page::html();

if ($xml = Sitemap::page()) {
    $page->send($xml);
}

$html = '<p>Content</p>';

Sitemap::add('pages', $html);

$page->send($page->display($html));

License

The MIT License (MIT). Please see License File for more information.