Skip to content

Commit

Permalink
Series plugin blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
jtama committed Dec 6, 2024
1 parent 501d215 commit 7713cdc
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
61 changes: 61 additions & 0 deletions blog/content/posts/2024-12-06-series.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
layout: :theme/post
title: Want to a blog post series ?
image: https://images.unsplash.com/photo-1516031391404-50a63b60f9f6?q=80&w=3870&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
description: Make your blog posts part of a series.
author: jtama
tags: series, guide, cool-stuff
date: 2024-12-06 09:00:00 +0200
series: roq-plugins
---

So you plan to do a series of blog posts about a given subject.
This is as simple as adding a `series` attribute to the front matter of your posts.

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

[source,xml]
----
<dependency>
<groupId>io.quarkiverse.roq</groupId>
<artifactId>quarkus-roq-plugin-series</artifactId>
<version>$\{quarkus-roq.version}</version>
</dependency>
----

*Step 2:* Edit the layout for your posts, for example when using roq-default theme:

[source,html]
.templates/layouts/roq-default/post-series.html
----
---
layout: theme-layouts/roq-default/post
---
\{#include partials/roq-series /} <1>
\{#insert /} <2>
----
<1> This will add the series partial before the post content, if it’s declared.
<2> This is the post content.

And finally, use this layout and add the series attribute in the Front Matter of the posts you want to join.

[source,yaml]
----
---
layout: series-post
title: Assemble you blog post in a series
description: Automatically series header for your posts
tags: plugin, frontmatter, guide, series
author: John Doe
series: My series Title <1>
---
----
<1> You should use the exact same title for all documents in the series.

It will add the following at the head of your post:

image::{site.imagesDirUrl.resolve('series.png')}[Series header]

A bit like what you see at the very begining of this post.
2 changes: 1 addition & 1 deletion blog/data/authors.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
jtama:
name: "Jérôme Tama"
avatar: "https://github.com/jtama.png"
job: Ce que je veux
job: Architect/Tech Lead
profile: "https://x.com/jtama_"
nickname: "jtama"
bio: "Passionate about Java, Quarkus, containers, and documentation as code, I mainly develop, train, and sometimes contribute to OSS projects"
Expand Down
Binary file added blog/static/assets/images/series.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ The standard `imagedir` attribute is not supported.

You should instead place your images under the `static/assets/images` folder, and reference them with the image macro :

image::/static/assets/images/your_image.png[]

image::\{site.imagesDirUrl.resolve('your_image.png')}[Image description]


=== Collections
Expand Down

0 comments on commit 7713cdc

Please sign in to comment.