Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

66 update readme for v20 #68

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 43 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,51 @@
# Sitemap.xml

This app creates the sitemap.xml file for your site. It includes the required tags of a sitemap.xml (`<loc>`, `<lastmod>`, `<changefreq>` and `<priority>`). The app's features are very basic, so sending pull requests are encouraged.
This app provides two ways of generating a sitemaps:

The app has a setting to add any number of content types and their `change frequency` and `priority` to the sitemap.xml file. It also adds a controller mapping to the path of `sitemap.xml` on the root of the site - `[yoursite.something]/sitemap.xml`.
1. [Controller mapping](controller-mapping)
2. [Headless Integration](headless-intergration)


## Installation

Check Enonic Market for further details on installing apps in XP. You have multiple options. The easiest way is to just go to the Application admin tool inside Enonic XP and hit the "Install" button, now find this app and click "Install". Done!

## Controller mapping

This app comes with a controller mapping to the path of `sitemap.xml` on the root of the site - `[yoursite.something]/sitemap.xml`.

This means that any request that matches, for example https://www.example.com/sitemap.xml, will be sent to this app's sitemap controller.

The sitemap controller will respond with a sitemap.xml file.

It includes the required tags of a sitemap.xml (`<loc>`, `<lastmod>`, `<changefreq>` and `<priority>`).

Be aware that only content from the current site will be added to a site's sitemap.

## Defaults
> **_NOTE:_** The order of the controller mapping is set to 50.

### Priority
## Headless intergration

The `<priority>` tag has the default value of 0.5.
When doing external rendering, via for example Next.XP, you can fetch the data needed to generate a sitemap.xml file via a Guillotine Extension.

The site content itself will be added automatically with a `priority` set to `1.0` and `changeFrequency` set to `hourly`. If you want to overwrite these defaults, please add `portal:site` as a mapping manually and customize the settings.
Use the `Query playground` in Content Studio to study the Guillotine Schema. You can find a field named `sitemap` on the `HeadlessCms` object type.

### Number of included items
You may also study how we did it in our own [site-enonic-next](https://github.com/enonic/site-enonic-next).

By default, the app will include 10.000 items in the sitemap.xml file. This is to avoid the file getting too big. This setting can be modified in the app config dialog. If you want to include all items, set the value to `-1`.
> **_TIP:_** In the Next.XP app there is a controller mapping with a order of 11, so that it can provide it's own sitemap.xml

NB! The number of included items will affect the time it takes to generate the sitemap.xml file.
## Site configuration

## Configuration
The app has a site configuration where you can add content types and configure their `change frequency` and `priority`.

The app has a configuration dialog where you can add content types and their `change frequency` and `priority` to the sitemap.xml file. The app will automatically add the site content to the sitemap.xml file, if not added already in app settings.
The app will automatically add the site content, if not already added in the site configuration [mappings](mappings).

### Max included items

Limit the number of items in the file. Default: 10.000. Set to `-1` to include all items.

> **_WARNING:_** The number of included items will affect the time it takes to generate the sitemap.xml file.

### Override the generated domain name

By default, the app will use the domain name of the site. If you want to override this, you can specify a custom domain name in this field.
Expand All @@ -36,59 +54,33 @@ By default, the app will use the domain name of the site. If you want to overrid

Here you can specify which content types you want to include in the file and their `change frequency` and `priority` per content type.

#### Priority

The `<priority>` tag has the default value of 0.5.

The site content itself will be added automatically with a `priority` set to `1.0` and `changeFrequency` set to `hourly`. If you want to overwrite these defaults, please add `portal:site` as a mapping manually and customize the settings.

### Ignore list

Here you can add exclusion patterns for specific content paths.
For example, to exclude all paths ending with `/foo`, you can add the following pattern: `*/foo`


## Specification

Check out [Sitemaps XML format](https://www.sitemaps.org/protocol.html) to learn more about how it all works.

## Installation

Check Enonic Market for further details on installing apps in XP. You have multiple options. The easiest way is to just go to the Application admin tool inside Enonic XP and hit the "Install" button, now find this app and click "Install". Done!

## Releases and Compatibility
| Version | XP version |
|---------| ------------- |
| 1.5.0 | 7.1.0 |
| 1.4.0 | 7.1.0 |
| 1.3.0 | 7.1.0 |
| 1.2.0 | 7.0.0 |
| 1.1.1 | 6.10.2 |
| 1.1.0 | 6.10.2 |
| 1.0.1 | 6.8.0 |
| 1.0.0 | 6.8.0 |

## Changelog
## Upgrade Notes

**Version 1.3 and newer: see releases on the [Market page](https://market.enonic.com/vendors/enonic/com.enonic.app.sitemapxml)**
### 1.x.x to 2.0.0

### Version 1.1.0
#### Sitemap service replaced by Guillotine Extension

Cudo's to [@nerdegutt](https://github.com/nerdegutt) for suggestions and pull requests that are part of this release.
In version 2.0.0 the sitemap service has been removed in favour of a Guillotine Extension.

**Code improvements**:
* Refactoring and improvements of code.
* Move most code logic out of view file and into controller.
* Send much less (a 20th) of the data from controller to view (XSL).
* Required XP version: **6.10**.
If you are using the controller mapping, this doesn't affect you.

**New functionality**:
* Automatically add the site content to sitemap.xml output, if not added already in app settings.
* Let users control `priority` field from app settings per content type.
* Only fetch content from the current site, even if mapped content types exists on other sites.
* If present, the robot settings from [SEO Meta Fields](https://market.enonic.com/vendors/enonic/com.enonic.app.metafields) app will be respected and used to filter the sitemap items.
If however you are doing external rendering, see [Headless integration](headless-integration).

### Version 1.0.1

* **Bug fixed:** Generate absolute URLs for `<loc>`-field.
* **Bug fixed:** Add missing `<priority>`-field (mentioned in the docs but not added in output).
* Add two more options to the field `<changefreq>` - "always" and "never", according to specification.
* Upgrade wrappers and build files to Gradle 3.

### Version 1.0.0
## Changelog

* First release
See the [Market page](https://market.enonic.com/vendors/enonic/com.enonic.app.sitemapxml)
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
group = com.enonic.app
projectName = sitemapxml
appName = com.enonic.app.sitemapxml
xpVersion=7.1.0
xpVersion=7.14.0
version=1.5.1-SNAPSHOT
Loading