diff --git a/ansibledoctor/templates/hugo-book/_vars.j2 b/ansibledoctor/templates/hugo-book/_vars.j2 index f823ec1..ab267ff 100644 --- a/ansibledoctor/templates/hugo-book/_vars.j2 +++ b/ansibledoctor/templates/hugo-book/_vars.j2 @@ -6,8 +6,9 @@ ### {{ key }} {% if item.description is defined and item.description %} +{% set description = [item.description] if item.description is string else item.description %} -{{ item.description | map("replace", "\n\n", "\n") | safe_join("\n") }} +{{ description | map("replace", "\n\n", "\n") | safe_join("\n") }} {% endif %} {% if item.value is defined and item.value %} diff --git a/ansibledoctor/templates/hugo-book/index.md.j2 b/ansibledoctor/templates/hugo-book/index.md.j2 index 94dc9e9..a815d96 100644 --- a/ansibledoctor/templates/hugo-book/index.md.j2 +++ b/ansibledoctor/templates/hugo-book/index.md.j2 @@ -9,8 +9,9 @@ summary: {{ meta.summary.value | safe_join(" ") }} --- {% endif %} {% if description | deep_get(meta, "description.value") %} +{% set description = [meta.description.value] if meta.description.value is string else meta.description.value %} -{{ meta.description.value | map("replace", "\n\n", "\n") | safe_join("\n") }} +{{ description | map("replace", "\n\n", "\n") | safe_join("\n") }} {% endif %} diff --git a/ansibledoctor/templates/readme/README.md.j2 b/ansibledoctor/templates/readme/README.md.j2 index 9bf5dd4..c8a4116 100644 --- a/ansibledoctor/templates/readme/README.md.j2 +++ b/ansibledoctor/templates/readme/README.md.j2 @@ -3,8 +3,9 @@ # {{ meta.name.value | safe_join(" ") }} {% endif %} {% if description | deep_get(meta, "description.value") %} +{% set description = [meta.description.value] if meta.description.value is string else meta.description.value %} -{{ meta.description.value | map("replace", "\n\n", "\n") | safe_join("\n") }} +{{ description | map("replace", "\n\n", "\n") | safe_join("\n") }} {% endif %} {# TOC #} diff --git a/ansibledoctor/templates/readme/_vars.j2 b/ansibledoctor/templates/readme/_vars.j2 index f823ec1..ab267ff 100644 --- a/ansibledoctor/templates/readme/_vars.j2 +++ b/ansibledoctor/templates/readme/_vars.j2 @@ -6,8 +6,9 @@ ### {{ key }} {% if item.description is defined and item.description %} +{% set description = [item.description] if item.description is string else item.description %} -{{ item.description | map("replace", "\n\n", "\n") | safe_join("\n") }} +{{ description | map("replace", "\n\n", "\n") | safe_join("\n") }} {% endif %} {% if item.value is defined and item.value %} diff --git a/example/other-role/README.md b/example/other-role/README.md index 44fe188..e417740 100644 --- a/example/other-role/README.md +++ b/example/other-role/README.md @@ -3,8 +3,7 @@ [![Build Status](https://img.shields.io/drone/build/thegeeklab/ansible-doctor?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/ansible-doctor) [![License: GPL-3.0](https://img.shields.io/github/license/thegeeklab/ansible-doctor)](https://github.com/thegeeklab/ansible-doctor/blob/main/LICENSE) -Role to demonstrate ansible-doctor. It is also possible to overwrite -the default description with an annotation. +Role to demonstrate ansible-doctor. ## Table of content diff --git a/example/other-role/meta/main.yml b/example/other-role/meta/main.yml index c42faa6..be57e83 100644 --- a/example/other-role/meta/main.yml +++ b/example/other-role/meta/main.yml @@ -1,8 +1,4 @@ --- -# @meta description: > -# Role to demonstrate ansible-doctor. It is also possible to overwrite -# the default description with an annotation. -# @end # @meta author: [John Doe](https\://blog.example.com) galaxy_info: description: Role to demonstrate ansible-doctor.