Quarkus Roq Plugins

Roq Plugin Tagging

This plugin allows to generate a dynamic (derived) collection based on a given collection tags.

To install it add:

<dependency>
    <groupId>io.quarkiverse.roq</groupId>
    <artifactId>quarkus-roq-plugin-tagging</artifactId>
    <version>1.0.5</version>
</dependency>

For example, let’s consider the posts collection, if multiple posts have tags: guide, then we would generate a /posts/tag/guide page for all the posts containing the guide tag. This works for any collection.

To enable tagging, create a layout template, add tagging: [collection id] in FM. As a result you will have access to a new derived collection named tagCollection. It is available through site.collections.get(page.data.tagCollection):

templates/layouts/tag.html
---
layout: main
tagging: posts
---

{#for post in site.collections.get(page.data.tagCollection)}
  {post.title}
{/for}

This also support pagination like any other collection, as tagging is already specifying the target collection, pagination can be enabled just with in FM paginate: true:

templates/layouts/tag.html
---
layout: main
tagging: posts
paginate: true
---

{#for post in site.collections.get(page.data.tagCollection).paginated(page.paginator)}
  {post.title}
{/for}

Roq Plugin Aliases

This plugin allows creating one or many aliases (redirections) for a page.

To install it, add the following code to your dependencies file:

<dependency>
    <groupId>io.quarkiverse.roq</groupId>
    <artifactId>quarkus-roq-plugin-aliases</artifactId>
    <version>1.0.5</version>
</dependency>

For example, consider that you want to create a shortened link for your post.

To create an alias, create a page and add aliases: [your-alias-here, another-alias-here] in the Front Matter (FM). As a result, you will have the possibility to access the page using a customized URL as alias.

content/posts/2024-08-29-welcome-to-roq.md
---
layout: :theme/post
title: "Welcome to Roq!"
date: 2024-08-29 13:32:20 +0200
description: This is the first article ever made with Quarkus Roq
img: posts/2024/08/blogging.jpg
tags: blogging
author: ia3andy
aliases: [first-roq-article-ever]
---

Now, when you access the URL http://localhost:8081/first-roq-article-ever, you will be redirected to the 2024-08-29-welcome-to-roq blog post.

you can use link templating in aliases

Roq Plugin AsciiDoc

This plugin allows to use asciidoc to produce content.

To install it add:

<dependency>
    <groupId>io.quarkiverse.roq</groupId>
    <artifactId>quarkus-roq-plugin-asciidoc</artifactId>
    <version>1.0.5</version>
</dependency>

Once done, every file with either '.adoc' or '.asciidoc' extension will be processed.

Roq Plugin Markdown

This plugin allows to use markdown to produce content.

Markdown plugin is already included in Quarkus Roq extension.

To install it add:

<dependency>
    <groupId>io.quarkiverse.roq</groupId>
    <artifactId>quarkus-roq-plugin-markdown</artifactId>
    <version>1.0.5</version>
</dependency>

Once done, every file with either '.md' or '.markdown' extension will be processed.

Roq Plugin QR Code

This plugin allows you to add a QR Code to your website.

To install it add:

<dependency>
    <groupId>io.quarkiverse.roq</groupId>
    <artifactId>quarkus-roq-plugin-qrcode</artifactId>
    <version>1.0.5</version>
</dependency>

Then create a template and add the {#qrcode …​} tag to it and style and size it as you want.

By default, the plugin produces HTML output compatible with both HTML and MarkDown templates. To use the plugin with asciidoc, set the asciidoc attribute to true (the default is false).

{#qrcode value="https://luigis.com/menu/" alt="Luigi's Menu" foreground="#000066" background="#FFFFFF" width=300 height=300 /} // Will generate HTML code
{#qrcode value="https://luigis.com/menu/" alt="Luigi's Menu" foreground="#000066" background="#FFFFFF" width=300 height=300 asciidoc=true/} // Will save the file in the static folder and generate an asciidoc image macro pointing to it