{"id":22300274,"url":"https://github.com/infinityloop-dev/sitemap","last_synced_at":"2025-07-29T02:31:37.222Z","repository":{"id":62529926,"uuid":"129891716","full_name":"infinityloop-dev/sitemap","owner":"infinityloop-dev","description":":wrench: Component for Nette framework which renders as xml sitemap.","archived":false,"fork":false,"pushed_at":"2020-05-01T13:34:23.000Z","size":46,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-21T18:26:32.867Z","etag":null,"topics":["component","nette","nette-component","php","sitemap"],"latest_commit_sha":null,"homepage":"https://www.infinityloop.dev","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/infinityloop-dev.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":null,"security":null,"support":null}},"created_at":"2018-04-17T11:06:19.000Z","updated_at":"2020-05-01T13:42:32.000Z","dependencies_parsed_at":"2022-11-02T14:31:00.427Z","dependency_job_id":null,"html_url":"https://github.com/infinityloop-dev/sitemap","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityloop-dev%2Fsitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityloop-dev%2Fsitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityloop-dev%2Fsitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityloop-dev%2Fsitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinityloop-dev","download_url":"https://codeload.github.com/infinityloop-dev/sitemap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227971952,"owners_count":17849421,"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":["component","nette","nette-component","php","sitemap"],"created_at":"2024-12-03T18:10:14.630Z","updated_at":"2024-12-03T18:10:15.275Z","avatar_url":"https://github.com/infinityloop-dev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sitemap\n:wrench: Sitemap generator component\n\n## Introduction\n\nThis componenet automaticaly generates sitemap from annotated presenter actions. Found actions are cached to improve performance.\n\n## Installation\n\nInstall package using composer\n\n```\ncomposer require nepttune/sitemap\n```\n\n## Dependencies\n\n- [nette/application](https://github.com/nette/application)\n- [nette/di](https://github.com/nette/di)\n- [nette/caching](https://github.com/nette/caching)\n\n## How to use\n\n- Implement `\\Nepttune\\TI\\ISitemap` interface and use `\\Nepttune\\TI\\TSitemap` trait in selected presenters (Those which should have links in sitemap.).\n- Add annotation `@sitemap` to selected actions.\n- Register `\\Nepttune\\Component\\ISitemapFactory` as service in cofiguration file.\n- Inject it into eg. SitemapPresenter, write `createComponent` method and use macro `{control}` in template file.\n  - Just as any other component.\n  - Content type is automaticaly set to `application/xml`.\n\n### Example configuration\n\n```\nservices:\n    - Nepttune\\Component\\ISitemapFactory\n```\nYou can optionaly provide configuration array and enable hreflang links to be included for each entry (Requires translator in presenter).\n```\nparameters:\n    sitemap:\n        hreflang: true\n        \nservices:\n    sitemapFactory:\n            implement: Nepttune\\Component\\ISitemapFactory\n            arguments:\n                - '%sitemap%'\n```\n\n### Example presenter\n\n```\nclass ExamplePresenter implements IPresenter, ISitemap\n{\n    use TSitemap;\n\n    /** @var  \\Nepttune\\Component\\ISitemapFactory */\n    protected $iSitemapFactory;\n    \n    public function __construct(\\Nepttune\\Component\\ISitemapFactory $ISitemapFactory)\n    {\n        $this-\u003eiSitemapFactory = $ISitemapFactory;\n    }\n    \n    public function actionSitemap()\n    {\n        $this-\u003egetHttpResponse()-\u003esetContentType('application/xml');\n    }\n    \n    /**\n     * @sitemap\n     */\n    public function actionExample()\n    {\n    }\n\n    protected function createComponentSitemap()\n    {\n        return $this-\u003eiSitemapFactory-\u003ecreate();\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinityloop-dev%2Fsitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinityloop-dev%2Fsitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinityloop-dev%2Fsitemap/lists"}