Laravelium Sitemap generator for Laravel

Overview

Laravelium Sitemap package

License PHP tests Maintainability Test Coverage Style Status Latest Stable Version Total Downloads

Laravelium Sitemap generator for Laravel.

Notes

  • Dev Branches are for development and are UNSTABLE (use on your own risk)!

Installation

Run the following command and provide the latest stable version (e.g v8.*) :

composer require laravelium/sitemap

or add the following to your composer.json file :

For Laravel 8

"laravelium/sitemap": "8.*"

(development branch)

"laravelium/sitemap": "8.x-dev"

For Laravel 7

"laravelium/sitemap": "7.*"

(development branch)

"laravelium/sitemap": "7.x-dev"

For Laravel 6

"laravelium/sitemap": "6.*"

(development branch)

"laravelium/sitemap": "6.x-dev"

For Laravel 5.8

"laravelium/sitemap": "3.1.*"

(development branch)

"laravelium/sitemap": "3.1.x-dev"

For Laravel 5.7

"laravelium/sitemap": "3.0.*"

(development branch)

"laravelium/sitemap": "3.0.x-dev"

For Laravel 5.6

"laravelium/sitemap": "2.8.*"

(development branch)

"laravelium/sitemap": "2.8.x-dev"

For Laravel 5.5

"laravelium/sitemap": "2.7.*"

(development branch)

"laravelium/sitemap": "2.7.x-dev"

Publish needed assets (styles, views, config files) :

php artisan vendor:publish --provider="Laravelium\Sitemap\SitemapServiceProvider"

Note: Composer won't update them after composer update, you'll need to do it manually!

Examples

and more in the Wiki.

Contribution guidelines

Before submiting new merge request or creating new issue, please read contribution guidelines.

License

This package is open-sourced software licensed under the MIT license.

Comments
  • Support Google News

    Support Google News

    I'm trying to help with issue #80. Adding googlenews array as last parameter in $sitemap->add method, you can configure values as google indicates. Also, you can use $sitemap->render('google-news') and $sitemap->store('google-news') for create google news sitemaps.

    opened by fikoborquez 3
  • Added cache support

    Added cache support

    Hi, I added cache support for sitemap.

    Here is how it works:

    We have 2 methods to configure it:

    • configuration file
    • via method setCache (this method has priority over configuration file, so we can override it if we needed to)

    When cache is enabled it checks for items in cache, if no items found it adds current items to cache,

    I moved all the variables to a separate file called Model to have better organized code.

    Also you may notice that I have added Carbon dependency to composer.json because I am using it for converting cache duration int value to time stamp.

    opened by jelovac 2
  • Add annotation in the type of google-news sitemap

    Add annotation in the type of google-news sitemap

    Hello Roumen,

    We need the annotation in the sitemap extension of google-news for the SEO purpose.

    An example of sitemap generated with the type of google-news:

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
      <url>
        <loc>http://news.cnyes.com/Content/20160608/20160608162912000610941.shtml</loc>
        <lastmod>2016-04-14T12:13:32+08:00</lastmod>
        <xhtml:link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.cnyes.com/news/id/2025534" />
        <news:news>
          <news:publication>
            <news:name>鉅亨網</news:name>
            <news:language>zh-tw</news:language>
          </news:publication>
          <news:publication_date>2016-06-08T00:30:24+08:00</news:publication_date>
          <news:title><![CDATA[安泰銀配發現金股利0.6元 連續6年發股利]]></news:title>
            <news:keywords><![CDATA[]]></news:keywords>
        </news:news>
      </url>
    </urlset>
    

    Reference: https://developers.google.com/webmasters/mobile-sites/mobile-seo/separate-urls#annotation-in-the-html

    opened by CaraWang 1
  • Laravel4 bug when calling $sitemap->store('xml', 'mysitemap');

    Laravel4 bug when calling $sitemap->store('xml', 'mysitemap');

    Next exception 'ErrorException' with message 'Undefined index: caption (View: ../vendor/roumen/sitemap/src/views/xml.blade.php)'

    Solution, that I found: In file roumen/sitemap/src/views/xml.blade.php:36

    Change

    echo "\t\t\t" . 'image:caption' . $image['caption'] . '/image:caption' . "\n";

    To

    if (isset($image['caption'])) echo "\t\t\t" . 'image:caption' . $image['caption'] . '/image:caption' . "\n";

    opened by kitolog 1
  • Multiple file sitemap duplicates data on each file

    Multiple file sitemap duplicates data on each file

    The service provider uses a ‘singleton closure’ approach and shares a single closure (and a single instance of the class) across the whole application. Since that class provides no way to remove data from its internal storage, each new sitemap file was including the data of all the previous files as well as its own data, leading to gigantic (incorrect) files and huge hardware resource consumption.

    To make it work properly, the service provider has to be modified to use classic closure binding instead of a shared closure, so that each resolution from the IoC container creates a new instance of the class.

    opened by patx1 1
  • L4 fixes for store()

    L4 fixes for store()

    Two small fixes for store method to be compatible with Laravel 4. Required some refactoring to avoid code duplication.

    My first attempt at a pull request on here, so let me know if there are any issues.

    Thanks and keep up the good work. :+1:

    opened by hantrick 1
  • Modified readme to fit laravel 5.5 installation

    Modified readme to fit laravel 5.5 installation

    I've modified the readme file to fit laravel 5.5.

    In laravel 5.5 - thanks to the package auto-discovery - you don't need to register the service provider manually. I have seen that you are using the package auto discovery in your composer.json file.

    Have a nice day, Jordan

    opened by jkniest 0
  • Add attribute of last modified time to google-news

    Add attribute of last modified time to google-news

    Hello Roumen,

    We need the attribute of last modified time in the sitemap extension of google-news.

    Here is an example of Google News Sitemaps: http://docs.escenic.com/seo-guide/1.1/google_news_sitemaps.html

    opened by CaraWang 0
  • bug fixed.

    bug fixed.

    hi Roumen,

    There is a minor issue in my case. As my expected there are 50,000 articles in each sitemap file.

    If I get 50,000 news items from database and my maximum size define as 50,000 in config file.

    it will not get into the logic below and not store sitemap file successfully.

    if ($this->model->getMaxSize() > 0 && count($this->model->getItems()) > $this->model->getMaxSize())

    so, I sent a pull request to fix this issue.

    Thanks for your useful package to generate sitemap!

    opened by jaric 0
  • Fixed Fail to render xml when use sub-directory URI

    Fixed Fail to render xml when use sub-directory URI

    Fixed Fail to render xml when use sub-directory URI (E.g http://domain.com/public/sitemap) with error

    • Failed to load resource: the server responded with a status of 404 (Not Found)
    opened by mnking 0
  • Fix return types

    Fix return types

    This PR aims to set the correct @return tag of the render() method and the @param tag of setCache().

    Currently they're both wrong because they point to a wrong or not imported namespace, and, because of this, PHPStan and other static analysis tools report several wrong return types.

    opened by danilopolani 0
  • feat: video link add

    feat: video link add

    This is an awesome package and very useful. I create a one-video tutorial of this package. please add it in the doc. so, it helps to peoples. Thanks for this great package for the community.

    opened by shailesh-ladumor 0
Releases(8.0.1)
  • 8.0.1(Sep 10, 2020)

  • v2.8.1(Feb 7, 2018)

  • v2.7.2(Sep 7, 2017)

  • v2.6.5(Dec 19, 2016)

  • v2.6.4(Aug 27, 2016)

  • v2.6.3(Apr 27, 2016)

  • v2.6.2(Feb 7, 2016)

    Changes:

    • Various fixes and optimizations
    • Added support for multidimensional arrays in $sitemap->addItem();
    • Added option for custom path for $sitemap->store('format', 'filename', 'path', 'style');
    • Added option for custom style in $sitemap->store('format', 'filename', 'path', 'style');
    • Added option for custom style in $sitemap->render('format', 'style');
    • Added option for custom size limit for sitemaps $sitemap->model->setMaxSize(1000);
    • Updated xsl styles
    Source code(tar.gz)
    Source code(zip)
  • v2.6.1(Dec 30, 2015)

    • added xsl styles for all xml sitemaps
    • added xml-mobile sitemap format (for feature phones)
    • added alternate media tag options for xml sitemaps
    • fixed sitemap limit for google-news format (max 1000 links)
    • other small fixes and improvements
    Source code(tar.gz)
    Source code(zip)
Owner
Laravelium
Laravelium
PHP Sitemap Generator

This class can be used to generate sitemaps and notify updates to search engines.

Paweł Antczak 146 Nov 15, 2022
The simplest way to create a dynamic sitemap for your self-coded website which you have made by using PHP/HTML/CSS/Js etc... Scripts.

Sitemap_index.xml The simplest way to create a dynamic sitemap for your self-coded website which you have made by using PHP/HTML/CSS/Js etc... Scripts

Tanish Raj 1 Oct 16, 2021
A PHP sitemap generation tool.

Cartographer A sitemap generation tool for PHP following the Sitemap Protocol v0.9. Cartographer can handle Sitemaps of any size. When generating site

Tackk Inc. 332 Dec 23, 2022
GPT-3 powered business idea generator

The idea (lol) is to give you inspiration to make something cool, if you lack inspiration right now. Many ideas might not be perfect but they might give you the spark to start thinking to get to a really good idea further on.

levelsio 17 Feb 9, 2022
Contracts for Rule Doc Generator. Useful for production code with minimum dependencies.

Rule Doc Generator Contracts Contracts for Rule Doc Generator. Useful for production code with minimum dependencies. Install composer require symplify

null 19 Dec 22, 2022
Algerian code generator for invoices, quotes or any commercial documents

Algerian invoice code generator The library is useful to generate code for invoices, quotes or any commercial transaction document. Goal Is to provide

Hippone Consulting 7 Jul 19, 2021
Magento 2 Code Generator

Magento 2 Code Generator Created by Orba Inspired by https://github.com/staempfli/magento2-code-generator Purpose In day-to-day Magento 2 development

null 74 Nov 14, 2022
64 bit ID Generator

Particle Language: PHP 64bits int Time Based ID Generator Uncoordinated For high availability within and across data centers, machines generating ids

Silviu | ซีลวิอุ 130 Jul 26, 2022
A simple e-Certificate generator.

SeaJell A simple e-Certificate Generator. Guides You can read all the guides in using the system from the documentation. License Copyright (c) Muhamma

The SeaJell Project 22 Oct 4, 2022
Wordpress Plugin Boilerplate but Powered with examples and a generator!

WordPress Plugin Boilerplate Powered WordPress Plugin Boilerplate Powered is a complete foundation for building your WordPress plugins following PSR-4

WordPress Plugin Boilerplate Powered 604 Dec 24, 2022
Invoice PDF Generator For Magento 2

Magento Invoice PDF Generator Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2. If you have an enabled templat

EAdesign 66 Dec 13, 2022
Code generator for Magento 2

Magento 2 Code Generator Tool Installation Option1: Downloading .phar wget https://github.com/staempfli/magento2-code-generator/releases/download/<ver

Stämpfli AG 254 Dec 5, 2022
Runtime Code Generator like Lombok for PocketMine-MP

PlumbokPM Runtime Code Generator like Lombok for PocketMine-MP. Code generation starts when additional autoloader detects class uses PlumbokPM annotat

OctoPush 4 Apr 18, 2022
Windowy is a transaction-focused temporary inventory generator made for PocketMine-MP

About Windowy is a transaction-focused temporary inventory generator made for PocketMine-MP. How to use Windowy comes with 3 registered inventories us

DayKoala ʕ•ᴥ•ʔ 19 Aug 12, 2022
DTO Generator - PHP library for generating DTO classes

DTO Generator PHP library for generating DTO classes. Installation Use the package manager composer to install micro/dto. composer require micro/dto U

Micro PHP Framework 6 Dec 31, 2022
A QR Code generator for PHP7.4+

chillerlan/php-qrcode A PHP 7.4+ QR Code library based on the implementation by Kazuhiko Arase, namespaced, cleaned up, improved and other stuff. Docu

chillerlan 1.2k Dec 30, 2022
Stupid async implementation using await-generator

libAsync Stupid async implementation using await-generator Usage libAsync::doAsync(Closure $executor); // <-- Returns a promise Example Fetch data fro

null 5 Jan 2, 2023
Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.

Laravel Blog Have you worked with Wordpress? Developers call this package wordpress-like laravel blog. Give our package a Star to support us ⭐ ?? Inst

Binshops 279 Dec 28, 2022
A Simple Linode SDK built for Laravel with @JustSteveKing laravel-transporter package

linode client A Simple Linode client built for Laravel with @JustSteveKing laravel-transporter package Installation You can install the package via co

Samuel Mwangi 2 Dec 14, 2022