Hello!
Well, this is my first extension for Flarum (just studying this platform), and is really simple and need a lot of improvements and I will do this. (really, this will be 1000% better)

Actually this extension just generate a new sitemap when a new Discussion is started, I know, is not the best way to do this, probably this can be used just in small~medium communities for now.

This extension generate a sitemap link for:

Home page
Page Extension
Tag Extension
Discussions
Users

The sitemap.xml file is located in http://yourwebsite.com/sitemap.xml

To Do

-Rewrite new sitemap generator
-Generate a new sitemap file when actual sitemap have 50,000 links.
-Dinamically change sitemap aspects
-Panel in administration giving options to change basic informations about sitemap
-Configure and send new updates to search engines

Install

composer require terabin/flarum-ext-sitemap

This is the first release, so, any bugs, just report here, type

composer remove terabin/flarum-ext-sitemap

And wait for a new version. ?

Update
Actually I use this extension in a fórum with 5,000 discussions and 14,000 posts, and everything works fine.

    Everyone would need one when they will be asked by Google Webmasters.

    So, it will automagic-matically generate/inserted/update it a sitemap.xml file, once the new post was created? ?

    • FBI replied to this.

      FBI
      I've just read from Github

      $events->listen(DiscussionWasStarted::class, function (DiscussionWasStarted $event) {
      $this->UpdateSitemap();

      Sitemap was update it after discussion was created ?
      Is it work for sub-directory of flarum installation?

      $sitemap = new Sitemap(DIR . '/../../../../../sitemap.xml');

      Because I tried, several times. Error occur during create discussion, and still on Discussion Windows.
      But, actually discussion created succesfully on background (refresh the page).

      And with FTP I dont see any sitemap file was created.

        FBI
        Probably this problem is related in extensions.

        If you don't have page or tag extensions installed, this error appears. I will correct this today and post e new release.

        a month later
        9 days later

        Hey there,

        Congrats for the extension...

        I have v1.0.1-beta.2 and even though I have both Tags and Pages plugins installed I have the same error as FBI indicated here.

        Any idea why? Each time I'm trying to create a new post, the error appears, the post creation box stays on the page, but the message is created (just created a discussion 3 times ?)

        Thanks

          Flarum has not focused on SEO, yet. Sitemap sure helps in SEO.