Skip to content

Commit

Permalink
feat(core): improve SEO on plugin documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu authored and tchiotludo committed Apr 17, 2023
1 parent 38dba95 commit 27404b7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ClassPluginDocumentation<T> {
private String cls;
private String icon;
private String group;
private String pluginTitle;
private String subGroup;
private String shortName;
private String docDescription;
Expand All @@ -35,6 +36,7 @@ public class ClassPluginDocumentation<T> {
private ClassPluginDocumentation(JsonSchemaGenerator jsonSchemaGenerator, RegisteredPlugin plugin, Class<? extends T> cls, Class<T> baseCls) {
this.cls = cls.getName();
this.group = plugin.group();
this.pluginTitle = plugin.title();
this.icon = DocumentationGenerator.icon(plugin, cls);

if (this.group != null && cls.getPackageName().startsWith(this.group) && cls.getPackageName().length() > this.group.length()) {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/docs/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: {{ capitalizeFirst (replace title "-" " ") }}
{{#if description}}description: {{ description }}{{~/if}}
editLink: false
{{#if icon}}icon: {{ icon }}{{~/if}}
---
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/docs/task.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: {{json shortName}}
title: {{ capitalizeFirst (replace pluginTitle "-" " ") }} {{shortName}}
editLink: false
{{#if docDescription}}
description: {{ json docDescription }}
description: {{ docDescription }}
{{~/if}}
{{#if icon}}
icon: {{ icon }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void tasks() throws URISyntaxException, IOException {
String render = DocumentationGenerator.render(doc);

assertThat(render, containsString("ExampleTask"));
assertThat(render, containsString("description: \"Short description for this task\""));
assertThat(render, containsString("description: Short description for this task"));
assertThat(render, containsString("`VALUE_1`"));
assertThat(render, containsString("`VALUE_2`"));
}
Expand Down

0 comments on commit 27404b7

Please sign in to comment.