{"id":13606514,"url":"https://github.com/wintercms/wn-sitemap-plugin","last_synced_at":"2025-05-13T16:31:41.122Z","repository":{"id":41382583,"uuid":"345012884","full_name":"wintercms/wn-sitemap-plugin","owner":"wintercms","description":"Sitemap plugin for Winter CMS","archived":false,"fork":false,"pushed_at":"2024-12-16T03:34:38.000Z","size":153,"stargazers_count":10,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-06T23:49:08.012Z","etag":null,"topics":["hacktoberfest","plugin","sitemap","wintercms"],"latest_commit_sha":null,"homepage":"https://wintercms.com/","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/wintercms.png","metadata":{"funding":{"github":"wintercms","open_collective":"wintercms"},"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-06T05:22:35.000Z","updated_at":"2025-02-08T17:22:55.000Z","dependencies_parsed_at":"2024-04-11T05:27:45.143Z","dependency_job_id":"a359680a-9d93-4d3e-8c4c-d50364292707","html_url":"https://github.com/wintercms/wn-sitemap-plugin","commit_stats":{"total_commits":124,"total_committers":29,"mean_commits":4.275862068965517,"dds":0.7661290322580645,"last_synced_commit":"f9a952a96a33d9e3004e732745bbbb6d70d99402"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fwn-sitemap-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fwn-sitemap-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fwn-sitemap-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fwn-sitemap-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wintercms","download_url":"https://codeload.github.com/wintercms/wn-sitemap-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253545213,"owners_count":21925353,"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":["hacktoberfest","plugin","sitemap","wintercms"],"created_at":"2024-08-01T19:01:09.819Z","updated_at":"2025-05-13T16:31:40.302Z","avatar_url":"https://github.com/wintercms.png","language":"PHP","funding_links":["https://github.com/sponsors/wintercms","https://opencollective.com/wintercms"],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Sitemap Plugin\n\nDynamically generates `sitemap.xml` files in Winter CMS based user-configured settings.\n\nSupports:\n- Single sitemap definition per theme\n- Sitemaps are automatically styled for human consumption using the default `sitemap.xsl` file.\n- Supports item types as registered by [Winter.Pages](https://github.com/wintercms/wn-pages-plugin) and compatible plugins (Static URL, CMS Page, Single Record, All Records in type, etc)\n- Supports custom sitemap item types\n\n## Installation\n\nThis plugin is available for installation via [Composer](http://getcomposer.org/).\n\n```bash\ncomposer require winter/wn-sitemap-plugin\n```\n\nAfter installing the plugin you will need to run the migrations and (if you are using a [public folder](https://wintercms.com/docs/develop/docs/setup/configuration#using-a-public-folder)) [republish your public directory](https://wintercms.com/docs/develop/docs/console/setup-maintenance#mirror-public-files).\n\n```bash\nphp artisan migrate\n```\n\n## Viewing the sitemap\n\nOnce this plugin is installed and the sitemap has been configured. The sitemap can be viewed by accessing the file relative to the website base path. For example, if the website is hosted at https://wintercms.com it can be viewed by opening this URL:\n\n    https://wintercms.com/sitemap.xml\n\n## Managing a sitemap definition\n\nThe sitemap is managed by selecting Sitemap from the Settings area of the back-end. There is a single sitemap definition for each theme and it will be created automatically.\n\nA sitemap definition can contain multiple items and each item has a number of properties. There are common properties for all item types, and some properties depend on the item type. The common item properties are **Priority** and **Change frequency**. The Priority defines the priority of this item relative to other items in the sitemap. The Change frequency defines how frequently the page is likely to change.\n\n#### Standard item types\nThe available item types depend on the installed plugins, but there are three basic item types that are supported out of the box.\n\n###### URL {.subheader}\nItems of this type are links to a specific fixed URL. That could be an URL of an or internal page. Items of this type don't have any other properties - just the title and URL.\n\n###### Static page {.subheader}\nItems of this type refer to static pages. The static page should be selected in the **Reference** drop-down list described below.\n\n###### All static pages {.subheader}\nItems of this type expand to create links to all static pages defined in the theme. \n\n#### Custom item types\nOther plugins can supply new item types. For example, the [Blog plugin](https://github.com/wintercms/wn-blog-plugin) supplies two more types:\n\n###### Blog category {.subheader}\nAn item of this type represents a link to a specific blog category. The category should be selected in the **Reference** drop-down. This type also requires selecting a **CMS page** that outputs a blog category.\n\n###### All blog categories {.subheader}\nAn item of this time expands into multiple items representing all blog existing categories. This type also requires selecting a **CMS page**.\n\n#### Definition item properties\nDepending on the selected item time you might need to provide other properties of the item. The available properties are described below.\n\n###### Reference {.subheader}\nA drop-down list of objects the item should refer to. The list content depends on the item type. For the **Static page** item type the list displays all static pages defined in the system. For the **Blog category** item type the list displays a list of blog categories.\n\n###### Allow nested items {.subheader}\nThis checkbox is available only for item types that suppose nested objects. For example, static pages are hierarchical, and this property is available for the **Static page** item type. On the other hand, blog categories are not hierarchical, and the checkbox is hidden.\n\n###### CMS Page {.subheader}\nThis drop-down is available for item types that require a special CMS page to refer to. For example, the **Blog category** item type requires a CMS page that hosts the `blogPosts` component. The CMS Page drop-down for this item type will only display pages that include this component.\n\n---\n\nThe Sitemap plugin works *out of the box* and does not require any direct development to operate.\n\n##### Registering new sitemap definition item types\n\nThe Sitemap plugin shares the same events for registering item types as the [Pages plugin](https://github.com/wintercms/wn-pages-plugin). See the documentation provided by this plugin for more information.\n\nA small addition is required when resolving items, via the following event:\n\n* `pages.menuitem.resolveItem` event handler \"resolves\" a menu item information and returns the actual item URL, title, an indicator whether the item is currently active, and subitems, if any.\n\n##### Resolving items\n\nWhen resolving an item, each item should return an extra key in the array called `mtime`. This should be a Date object (see `Carbon\\Carbon`) or a timestamp value compatible with PHP's `date()` function and represent the last time the link was modified.\n\nExpected result format:\n\n```\nArray (\n    [url] =\u003e https://example.com/blog/category/another-category\n    [mtime] =\u003e Carbon::now(),\n    [items] =\u003e Array (\n        [0] =\u003e Array (\n            [url] =\u003e https://example.com/blog/category/another-category\n            [mtime] =\u003e Carbon::now(),\n        )\n\n        [1] =\u003e Array (\n            [url] =\u003e https://example.com/blog/category/news\n            [mtime] =\u003e Carbon::now(),\n        )\n    )\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwintercms%2Fwn-sitemap-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwintercms%2Fwn-sitemap-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwintercms%2Fwn-sitemap-plugin/lists"}