Skip to content

Commit

Permalink
Allow special characters and @RoqnRoll test
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Jan 29, 2025
1 parent 108722d commit b8680a7
Show file tree
Hide file tree
Showing 198 changed files with 1,555 additions and 488 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:

- name: Store PR id
run: |
echo ${{ github.event.number }} > ./docs/target/generated-docs/pr-id.txt
echo ${{ github.event.number }} > ./roq-docs/target/generated-docs/pr-id.txt
- name: Publishing docs
uses: actions/upload-artifact@v4
with:
name: docs
path: ./docs/target/generated-docs
path: ./roq-docs/target/generated-docs
retention-days: 3

- name: Build blog
Expand Down
3 changes: 2 additions & 1 deletion blog/config/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
%gh-pages.site.url=https://pages.quarkiverse.io/
%gh-pages.quarkus.http.root-path=/quarkus-roq/
quarkus.web-bundler.dependencies.auto-import=all
quarkus.log.category."io.quarkiverse.roq.frontmatter.deployment".level=DEBUG
#quarkus.log.category."io.quarkiverse.roq.frontmatter.deployment".level=DEBUG
#quarkus.log.category."io.quarkiverse.roq.generator".level=DEBUG
quarkus.default-locale=en
quarkus.asciidoctorj.attributes.icons=font
quarkus.asciidoctorj.attributes.source-highlighter=highlight.js
1 change: 0 additions & 1 deletion blog/content/posts/2024-08-29-welcome-to-roq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
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
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-09-16-nice-url-experience.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: "Effortless URL Handling in Roq with Qute super-power"
date: 2024-09-16 13:32:20 +0200
description: Effortlessly manage both relative and absolute URLs with our enhanced Qute-powered feature. Utilizing the RoqUrl class, you can easily join and resolve paths, ensuring clean and predictable URLs. This update simplifies URL handling, making your code more efficient and your content easier to navigate and share.
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-09-19-drafts-and-future.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: "Easily manage Drafts and Future articles in Roq"
date: 2024-09-19 10:45:00 +0200
description: Roq SSG introduces a new feature that allows you to hide or show draft and future articles using simple Quarkus configurations. This update gives developers greater control over which content is visible, improving content management and workflow.
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-09-20-hightlight-js.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: "How to add syntax highlighting to your Roq site"
date: 2024-09-20 11:00:00 +0200
description: Learn how to integrate syntax highlighting into your Roq site using Highlight.js and the Quarkus web-bundler extension. This guide walks you through the simple steps to add it via the pom.xml, JavaScript, and SCSS files.
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-09-20-pagination.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: Mastering Pagination in Roq
image: https://images.unsplash.com/photo-1502126829571-83575bb53030?q=80&w=3474&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
description: Learn how to implement pagination in Roq to enhance your content navigation. This article walks through the process of adding pagination, configuring page size, and customizing links.
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-09-23-seo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: Out of the box awesome SEO
image: https://images.unsplash.com/photo-1562577309-2592ab84b1bc?q=80&w=3474&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
description: Learn how to implement SEO in Roq in a blink of an eye.
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-10-09-aliases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: The second Roq plugin is for redirecting your page to a better place!
image: https://images.unsplash.com/photo-1691210781188-b8c69945e620?q=80&w=1899&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
description: We introduced a way to declare aliases in FrontMatter. It is now easy create redirections to your blog posts!
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-10-10-rss-feed.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: RSS Feed of your blog posts
description: Automatically generate an RSS feed of your blog links.
image: https://images.unsplash.com/photo-1520636902994-f596446c3728?q=80&w=3198&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-10-22-asciidoc.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: Write your blog posts in AsciiDoc
description: Automatically generate html from AsciiDoc content
img: https://images.unsplash.com/photo-1455390582262-044cdead277a?q=80&w=3198&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-10-31-roq-with-blogs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: "Roq with Blogs"
description: 🚀 Roq 1.0 is ON! It is time to give it a shot and give us feedback 🚀
image: https://images.unsplash.com/photo-1458501534264-7d326fa0ca04?q=80&w=3540&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-11-14-qrcode.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
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.
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-12-06-series/index.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: Do you want to publish a blog post series ?
image: https://images.unsplash.com/photo-1621571029036-1573d2b1dc5c?q=80&w=3731&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
description: Make your blog posts part of a series.
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-12-10-happy-users.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: Already some happy users 🧑‍💻
image: https://images.unsplash.com/photo-1496449903678-68ddcb189a24?q=80&w=4140&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
description: This is a good start, we already have a few happy users!
Expand Down
1 change: 0 additions & 1 deletion blog/content/posts/2024-12-26-page-files/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: :theme/post
title: Static attached files for posts and pages
image: dina-badamshina-j7vbBmTHmjY-unsplash.jpg
description: |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions blog/content/posts/2025-01-28-roq-and-roll-test/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "Roq n Roll Your Tests"
description: Testing the actual Roq generation has never been this cool! 🎸
image: "c'est de la poussière d'étoile.jpg"
tags: cool-stuff
author: ia3andy
---

# Roq n Roll Your Tests 🎶

Hello folks,

I'm excited to share something very cool! I've developed a way to:
- Test the **full generation** of your website.
- Use **RestAssured** to test the generated site (thanks to an already started static server).

### Step 1: Add the Dependency

First, include the `quarkus-roq-testing` test dependency in your `pom.xml`.

### Step 2: Basic Test Example

Once you've added the dependency, you can easily ensure all pages are generated without errors:

```java
@QuarkusTest
@RoqAndRoll
public class RoqSiteTest {
// All pages will be validated during test setup
}
```

That's it! This basic test already verifies that your site generation is error-free.

---

### Step 3: Test the Generated Content

To go even further, you can test the actual content of your generated site. Here's how:

```java
@QuarkusTest
@RoqAndRoll
public class RoqSiteTest {
RoqServer roq; // Injected server info

@Test
public void testIndex() {
given().port(roq.port())
.when().get("/")
.then()
.statusCode(200)
.body(containsString(
"A Static Site Generator to easily create a static website or blog using Quarkus super-powers."
));
}
}
```

---

### Why I Love It ❤️

With just a few annotations and a bit of setup, you can effortlessly test both the generation process and the content of your site. It's powerful, elegant, and super simple to use.

Give it a try and let me know how it works for you. Happy testing! 🚀
7 changes: 6 additions & 1 deletion blog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.17.6</quarkus.platform.version>
<quarkus.platform.version>3.18.1</quarkus.platform.version>
<quarkus-roq.version>999-SNAPSHOT</quarkus-roq.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.5.2</surefire-plugin.version>
Expand Down Expand Up @@ -98,6 +98,11 @@
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkiverse.roq</groupId>
<artifactId>quarkus-roq-testing</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
Expand Down
7 changes: 0 additions & 7 deletions blog/src/test/java/io/quarkiverse/roq/it/RoqBlogIT.java

This file was deleted.

24 changes: 17 additions & 7 deletions blog/src/test/java/io/quarkiverse/roq/it/RoqBlogTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,39 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.*;

import io.quarkiverse.roq.testing.RoqServer;
import io.quarkiverse.roq.testing.RoqAndRoll;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.response.ValidatableResponse;
import org.junit.jupiter.api.Test;

@QuarkusTest
@RoqAndRoll
public class RoqBlogTest {

RoqServer roq;

@Test
public void testIndex() {
given().when().get("/").then().statusCode(200).body(containsString(
given().port(roq.port()).when().get("/").then().statusCode(200).body(containsString(
"A Static Site Generator to easily create a static website or blog using Quarkus super-powers."))
.body(containsString("Hello, world! I&#39;m Roq")).body(containsString("minute(s) read"))
.body(containsString("Page 1 of")).body(containsString("&copy; ROQ"));
}

@Test
public void testTag() {
given().when().get("/posts/tag/cool-stuff").then().statusCode(200).body(containsString("cool-stuff"));
given().port(roq.port()).when().get("/posts/tag/cool-stuff").then().statusCode(200).body(containsString("cool-stuff"));
}

@Test
public void testSlugifyFile() {
given().port(roq.port()).when().get("/posts/roq-n-roll-your-tests/c-est-de-la-poussi-re-d-toile.jpg").then().statusCode(200);
}

@Test
public void testPosts() {
given().when().get("/posts/welcome-to-roq").then().statusCode(200).body(containsString(
given().port(roq.port()).when().get("/posts/welcome-to-roq").then().statusCode(200).body(containsString(
"A Static Site Generator to easily create a static website or blog using Quarkus super-powers."))
.body(containsString("<p>Hello folks,</p>"))
.body(containsString("<h1 class=\"page-title\">Welcome to Roq!</h1>"))
Expand All @@ -43,28 +53,28 @@ public void testPostsAsciidoc() {

@Test
public void testPage() {
given().when().get("/events").then().statusCode(200).body(containsString(
given().port(roq.port()).when().get("/events").then().statusCode(200).body(containsString(
"A Static Site Generator to easily create a static website or blog using Quarkus super-powers."))
.body(containsString("<h2 class=\"event-title\">Roq 1.0 Beta</h2>"))
.body(containsString("&copy; ROQ"));
}

@Test
public void testAlias() {
given().when().get("/first-roq-article-ever/").then().statusCode(200)
given().port(roq.port()).when().get("/first-roq-article-ever/").then().statusCode(200)
.body(containsString("url=\"/posts/welcome-to-roq/\""));
}

@Test
public void testRss() {
given().when().get("/rss.xml").then().statusCode(200)
given().port(roq.port()).when().get("/rss.xml").then().statusCode(200)
.body(startsWith("<rss xmlns:dc="))
.body(endsWith("</rss>\n"));
}

@Test
public void testSitemap() {
given().when().get("/sitemap.xml").then().statusCode(200)
given().port(roq.port()).when().get("/sitemap.xml").then().statusCode(200)
.body(containsString("<urlset"))
.body(containsString("<loc>/</loc>"))
.body(containsString("<loc>/posts/page2/</loc>"))
Expand Down
110 changes: 0 additions & 110 deletions docs/modules/ROOT/pages/_includes/quarkus-roq-generator.adoc

This file was deleted.

Loading

0 comments on commit b8680a7

Please sign in to comment.