{"id":13544783,"url":"https://github.com/FriendsOfFlarum/sitemap","last_synced_at":"2025-04-02T14:31:48.284Z","repository":{"id":37398956,"uuid":"144069446","full_name":"FriendsOfFlarum/sitemap","owner":"FriendsOfFlarum","description":"Generate a sitemap.","archived":false,"fork":false,"pushed_at":"2024-10-04T09:10:48.000Z","size":600,"stargazers_count":14,"open_issues_count":2,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T22:37:24.967Z","etag":null,"topics":["discussions","flarum","forums","sitemap","sitemap-files"],"latest_commit_sha":null,"homepage":"https://discuss.flarum.org/d/14941","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FriendsOfFlarum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"fof"}},"created_at":"2018-08-08T21:29:23.000Z","updated_at":"2024-10-04T09:10:52.000Z","dependencies_parsed_at":"2024-04-14T10:24:45.587Z","dependency_job_id":"a3e75579-08d7-4710-b579-7b7f6bdd78b2","html_url":"https://github.com/FriendsOfFlarum/sitemap","commit_stats":{"total_commits":80,"total_committers":17,"mean_commits":4.705882352941177,"dds":0.75,"last_synced_commit":"83a10567304ef379d7d173609b57d24468411109"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfFlarum%2Fsitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfFlarum%2Fsitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfFlarum%2Fsitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfFlarum%2Fsitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendsOfFlarum","download_url":"https://codeload.github.com/FriendsOfFlarum/sitemap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246753987,"owners_count":20828255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discussions","flarum","forums","sitemap","sitemap-files"],"created_at":"2024-08-01T11:00:53.341Z","updated_at":"2025-04-02T14:31:48.244Z","avatar_url":"https://github.com/FriendsOfFlarum.png","language":"PHP","funding_links":["https://opencollective.com/fof","https://opencollective.com/fof/donate"],"categories":["Extensions"],"sub_categories":["Analytics \u0026 SEO ([:top:](#table-of-contents))"],"readme":"# Sitemap by FriendsOfFlarum\n[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/FriendsOfFlarum/sitemap/blob/master/LICENSE.md) [![Latest Stable Version](https://img.shields.io/packagist/v/fof/sitemap.svg)](https://packagist.org/packages/fof/sitemap) [![Total Downloads](https://img.shields.io/packagist/dt/fof/sitemap.svg)](https://packagist.org/packages/fof/sitemap) [![OpenCollective](https://img.shields.io/badge/opencollective-fof-blue.svg)](https://opencollective.com/fof/donate)\n\nThis extension simply adds a sitemap to your forum.\n\nIt uses default entries like Discussions and Users, but is also smart enough to conditionally add further entries\nbased on the availability of extensions. This currently applies to flarum/tags and fof/pages. Other extensions\ncan easily inject their own Resource information, check Extending below.\n\n## Modes\n\nThere are two modes to use the sitemap.\n\n### Runtime mode\n\nAfter enabling the extension the sitemap will automatically be available and generated on the fly.\nIt contains all Users, Discussions, Tags and Pages guests have access to.\n\n_Applicable to small forums, most likely on shared hosting environments, with discussions, users, tags and pages summed\nup being less than **10.000 items**.\nThis is not a hard limit, but performance will be degraded as the number of items increase._\n\n### Cached multi-file mode\n\nFor larger forums you can set up a cron job that generates a sitemap index and compressed sitemap files.\nA first sitemap will be automatically generated after the setting is changed, but subsequent updates will have to be triggered either manually or through the scheduler (see below).\n\nA rebuild can be manually triggered at any time by using:\n\n```\nphp flarum fof:sitemap:build\n```\n\n_Best for larger forums, starting at 10.000 items._\n\n### Risky Performance Improvements\n\n_This setting is meant for large enterprise customers._\n\nThe optional \"Enable risky performance improvements\" option modifies the discussion and user SQL queries to limit the number of columns returned.\nBy removing those columns, it significantly reduces the size of the database response but might break custom visibility scopes or slug drivers added by extensions.\n\nThis setting only brings noticeable improvements if you have millions of discussions or users.\nWe recommend not enabling it unless the CRON job takes more than an hour to run or that the SQL connection gets saturated by the amount of data.\n\n## Scheduling\n\nConsider setting up the Flarum scheduler, which removes the requirement to setup a cron job as advised above.\nRead more information about this [here](https://discuss.flarum.org/d/24118)\n\nThe frequency setting for the scheduler can be customized via the extension settings page.\n\n## Installation\n\nThis extension requires PHP 8.0 or greater.\n\nInstall manually with composer:\n\n```bash\ncomposer require fof/sitemap\n```\n\n## Updating\n\n```bash\ncomposer update fof/sitemap\nphp flarum migrate\nphp flarum cache:clear\n```\n\n## Nginx issues\n\nIf you are using nginx and accessing `/sitemap.xml` results in an nginx 404 page, you can add the following rule to your configuration file, underneath your existing `location` rule:\n\n```\nlocation = /sitemap.xml {\n    try_files $uri $uri/ /index.php?$query_string;\n}\n```\n\nThis rule makes sure that Flarum will answer the request for `/sitemap.xml` when no file exists with that name.\n\n## Extending\n\n### Register a new Resource\n\nIn order to register your own resource, create a class that implements `FoF\\Sitemap\\Resources\\Resource`. Make sure\nto implement all abstract methods, check other implementations for examples. After this, register your\n\n```php\nreturn [\n    new \\FoF\\Sitemap\\Extend\\RegisterResource(YourResource::class),\n];\n```\nThat's it.\n\n### Remove a Resource\n\nIn a very similar way, you can also remove resources from the sitemap:\n```php\nreturn [\n    (new \\FoF\\Sitemap\\Extend\\RemoveResource(\\FoF\\Sitemap\\Resources\\Tag::class)),\n];\n```\n\n### Register a static URL\n\nSome pages of your forum might not be covered by the default resources. To add those urls to the sitemap there is a\npseudo resource called `StaticUrls`. You can use the `RegisterStaticUrl` extender to add your own urls. The extender\ntakes a route name as parameter, which will be resolved to a url using the `Flarum\\Http\\UrlGenerator` class.\n```php\nreturn [\n    (new \\FoF\\Sitemap\\Extend\\RegisterStaticUrl('reviews.index')),\n];\n```\n\n### Force cache mode\n\nIf you wish to force the use of cache mode, for example in complex hosted environments, this can be done by calling the extender:\n```php\nreturn [\n    (new \\FoF\\Sitemap\\Extend\\ForceCached()),\n]\n```\n\n## Commissioned\n\nThe initial version of this extension was sponsored by [profesionalreview.com](https://www.profesionalreview.com/).\n\n## Links\n\n- [![OpenCollective](https://img.shields.io/badge/donate-friendsofflarum-44AEE5?style=for-the-badge\u0026logo=open-collective)](https://opencollective.com/fof/donate)\n- [Flarum Discuss post](https://discuss.flarum.org/d/14941)\n- [Source code on GitHub](https://github.com/FriendsOfFlarum/sitemap)\n- [Report an issue](https://github.com/FriendsOFflarum/sitemap/issues)\n- [Download via Packagist](https://packagist.org/packages/fof/sitemap)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFriendsOfFlarum%2Fsitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFriendsOfFlarum%2Fsitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFriendsOfFlarum%2Fsitemap/lists"}