Skip to content

brightspot/flat-sitemap

Repository files navigation

Flat Sitemap

This extension enabled Brightspot to create a "flat" sitemap.xml for smaller sites that do not benefit from the "year/month" sitemap partitioning strategy.

The Flat Sitemap XML is regenerated every 6 hours.

Prerequisites

This extension requires an instance of Brightspot and access to the project source code.

Installation

Gradle:

api 'com.brightspot:flat-sitemap:1.0.0'

Maven:

<dependency>
    <groupId>com.brightspot</groupId>
    <artifactId>flat-sitemap</artifactId>
    <version>1.0.0</version>
</dependency>

Substitute 1.0.0 for the desired version found on the releases list.

Usage

To enable this behavior, enable the "Flat" sitemap type in Sites & Settings.

If 50,000 or fewer sitemap items are found, the following files structure will be generated:

  • /flat-sitemap.xml (Index)
    • /flat-sitemap-content.xml (All sitemap content)

If greater than 50,000 sitemap items are found, the following files will be generated:

  • /flat-sitemap.xml (Index)
    • /flat-sitemap-content.1.xml (First 50,000 URLs)
    • /flat-sitemap-content.2.xml (Next 50,000 URLs, etc.)

Note

If the "Standard" sitemap type is not enabled, the flat-sitemap-content files are also available at the following paths:

  • /sitemap.xml (alias of /sitemap.1.xml)
  • /sitemap.1.xml (also available at /sitemap.xml)
  • /sitemap.2.xml

So, it is recommended to:

  • First enable the Flat sitemap type
  • Test and validate using the URLs found in /flat-sitemap.xml
  • Finally disable the Standard sitemap type to enable the /sitemap.xml URL rewrites.

Documentation

Versioning

The version numbers for this extension will strictly follow Semantic Versioning.

Contributing

If you have feedback, suggestions or comments on this open-source platform extension, please feel free to make them publicly on the issues tab here.

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Local Development

Assuming you already have a local Brightspot instance up and running, you can test this extension by running the following command from this project's root directory to install a SNAPSHOT to your local Maven repository:

./gradlew -Prelease=local publishToMavenLocal

Next, ensure your project's build.gradle file contains

repositories {
    mavenLocal()
}

Then, add the following to your project's build.gradle file:

dependencies {
    api 'com.brightspot:flat-sitemap:local'
}

Finally, compile your project and run your local Brightspot instance.

License

See: LICENSE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published