Easily Generate a `sitemap.xml` for Your Site with Roq

Easily Generate a `sitemap.xml` for Your Site with Roq

2025, Jan 08    

Creating a sitemap.xml for your site has never been easier! With the Sitemap plugin, you can automatically generate a well-structured sitemap for search engines to crawl your pages efficiently.

Installation

To get started, install the plugin by running the following command:

quarkus ext add quarkus-roq-plugin-sitemap

Setting Up the Sitemap

Next, create a new sitemap file in the content/sitemap.xml:

<!-- Include your sitemap template -->
{#include fm/sitemap.xml}

And that's it! Your sitemap is now ready.

Excluding Pages from the Sitemap

If there are pages you don't want included in the sitemap, simply set the sitemap property to false in the FM of those pages. For example:

---
title: "Hidden Page"
sitemap: false
---

Accessing Your Sitemap

Once your site is up and running, you can view your sitemap by navigating to:

http://localhost:8080/sitemap.xml

Congratulations! You’ve successfully set up a sitemap.xml for your site.