Skip to content

Commit

Permalink
Fix #271: Add QR Code support (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Nov 18, 2024
1 parent 12e6304 commit 89f53e3
Show file tree
Hide file tree
Showing 16 changed files with 951 additions and 1 deletion.
3 changes: 3 additions & 0 deletions blog/content/posts/2024-10-31-roq-with-blogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ tags: blogging
author: ia3andy
---

{#qrcode value="https://pages.quarkiverse.io/quarkus-roq/" alt="QR Code for the blog" foreground="000000" background="FFFFFF" width=300 height=300 /}

<br/
Hello folks,

First let me thanks the Roq [contributors]({site.url('about')}), they have been awesome and this has been so fun to create Roq!
Expand Down
33 changes: 33 additions & 0 deletions blog/content/posts/2024-11-14-qrcode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: :theme/post
title: Need a QR Code?
image: https://images.unsplash.com/photo-1726255294277-57c46883bd94?q=80&w=3870&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
description: Add a QR Code to your Roq website.
author: ia3andy
tags: qrcode, guide, cool-stuff
date: 2024-11-14 14:00:00 +0200
---

Need to add a scannable QR Code to your website? Whether it's for a restaurant menu, event ticket, or any other use case where you want to make your content easily accessible via mobile devices, the Roq QR Code plugin has you covered.

**Step 1:** Add the QRCode plugin in your dependencies file:

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

**Step 2:** Add the QRCode tag to your template with all the parameters you need:

```html
\{#qrcode value="https://luigis.com/menu/" alt="Luigi's Menu" foreground="#000066" background="#FFFFFF" width=300 height=300 /}
```

It will render a QR Code like this:

<div style="text-align: center">
{#qrcode value="https://luigis.com/menu/" alt="Luigi's Menu" foreground="#000066" background="#FFFFFF" width=300 height=300 /}
</div>
5 changes: 5 additions & 0 deletions blog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
<artifactId>quarkus-roq-plugin-asciidoc</artifactId>
<version>${quarkus-roq.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.roq</groupId>
<artifactId>quarkus-roq-plugin-qrcode</artifactId>
<version>${quarkus-roq.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
Expand Down
285 changes: 285 additions & 0 deletions docs/modules/ROOT/pages/includes/quarkus-roq-frontmatter_quarkus.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
[.configuration-legend]
icon:lock[title=Fixed at build time] Configuration property fixed at build time - All other configuration properties are overridable at runtime
[.configuration-reference.searchable, cols="80,.^10,.^10"]
|===

h|[.header-title]##Configuration property##
h|Type
h|Default

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-root-path]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-root-path[`quarkus.root-path`]##

[.description]
--
The root path of your site (e.g. /blog) relative the quarkus http root path. This is to be used only when the site is living next to a Quarkus application. Use `quarkus.http.root-path` for GitHub Pages relative url.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_ROOT_PATH+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_ROOT_PATH+++`
endif::add-copy-button-to-env-var[]
--
|string
|`/`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-url]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-url[`quarkus.url`]##

[.description]
--
the base hostname & protocol for your site, e.g. http://example.com


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_URL+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_URL+++`
endif::add-copy-button-to-env-var[]
--
|string
|

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-route-order]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-route-order[`quarkus.route-order`]##

[.description]
--
The order of the route which handles the templates.
<p>
By default, the route is executed before the default routes (static resources, etc.).


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_ROUTE_ORDER+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_ROUTE_ORDER+++`
endif::add-copy-button-to-env-var[]
--
|int
|`1100`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-ignored-files]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-ignored-files[`quarkus.ignored-files`]##

[.description]
--
The ignored files in the different Roq site directories (you can use glob expressions).


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_IGNORED_FILES+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_IGNORED_FILES+++`
endif::add-copy-button-to-env-var[]
--
|list of string
|`**/_**,_**,.**`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-content-dir]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-content-dir[`quarkus.content-dir`]##

[.description]
--
The directory which contains content (pages and collections) in the Roq site directory.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_CONTENT_DIR+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_CONTENT_DIR+++`
endif::add-copy-button-to-env-var[]
--
|string
|`content`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-static-dir]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-static-dir[`quarkus.static-dir`]##

[.description]
--
The directory which contains static files to be served (dir name)


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_STATIC_DIR+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_STATIC_DIR+++`
endif::add-copy-button-to-env-var[]
--
|string
|`static`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-generator]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-generator[`quarkus.generator`]##

[.description]
--
When enabled it will select all FrontMatter pages in Roq Generator


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_GENERATOR+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_GENERATOR+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-future]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-future[`quarkus.future`]##

[.description]
--
Show future documents


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_FUTURE+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_FUTURE+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`false`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-images-path]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-images-path[`quarkus.images-path`]##

[.description]
--
The public path containing pages and documents images (relative to the site path)


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_IMAGES_PATH+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_IMAGES_PATH+++`
endif::add-copy-button-to-env-var[]
--
|string
|`static/assets/images`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-theme]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-theme[`quarkus.theme`]##

[.description]
--
This will be used to replace `:theme` when resolving layouts (e.g. `layout: :theme/main.html`)


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_THEME+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_THEME+++`
endif::add-copy-button-to-env-var[]
--
|string
|

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-draft]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-draft[`quarkus.draft`]##

[.description]
--
Show draft pages


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_DRAFT+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_DRAFT+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`false`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-date-format]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-date-format[`quarkus.date-format`]##

[.description]
--
Format for dates


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_DATE_FORMAT+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_DATE_FORMAT+++`
endif::add-copy-button-to-env-var[]
--
|string
|`yyyy-MM-dd[ HH:mm][:ss][ Z]`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-time-zone]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-time-zone[`quarkus.time-zone`]##

[.description]
--
The default timezone


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_TIME_ZONE+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_TIME_ZONE+++`
endif::add-copy-button-to-env-var[]
--
|string
|`document timezone if provided or system timezone`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-collections-collections-map]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-collections-collections-map[`quarkus.collections."collections-map"`]##

[.description]
--
If this collection is enabled


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_COLLECTIONS__COLLECTIONS_MAP_+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_COLLECTIONS__COLLECTIONS_MAP_+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-collections-collections-map-future]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-collections-collections-map-future[`quarkus.collections."collections-map".future`]##

[.description]
--
Show future documents (overrides global future for this collection)


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_COLLECTIONS__COLLECTIONS_MAP__FUTURE+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_COLLECTIONS__COLLECTIONS_MAP__FUTURE+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`false`

a|icon:lock[title=Fixed at build time] [[quarkus-roq-frontmatter_quarkus-collections-collections-map-hidden]] [.property-path]##link:#quarkus-roq-frontmatter_quarkus-collections-collections-map-hidden[`quarkus.collections."collections-map".hidden`]##

[.description]
--
If true, the collection won't be available on path but consumable as data.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_COLLECTIONS__COLLECTIONS_MAP__HIDDEN+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_COLLECTIONS__COLLECTIONS_MAP__HIDDEN+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`false`

|===

24 changes: 23 additions & 1 deletion docs/modules/ROOT/pages/quarkus-roq-plugins.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,26 @@ To install it add:
</dependency>
----

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

[#plugin-qrcode]
== Roq Plugin QR Code

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

To install it add:
[source,xml,subs=attributes+]
----
<dependency>
<groupId>io.quarkiverse.roq</groupId>
<artifactId>quarkus-roq-plugin-qrcode</artifactId>
<version>{project-version}</version>
</dependency>
----

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

[source,yaml]
----
{#qrcode value="https://luigis.com/menu/" alt="Luigi's Menu" foreground="#000066" background="#FFFFFF" width=300 height=300 /}
----
1 change: 1 addition & 0 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
<module>aliases</module>
<module>markdown</module>
<module>asciidoc</module>
<module>qrcode</module>
</modules>
</project>
Loading

0 comments on commit 89f53e3

Please sign in to comment.