Skip to content

Commit

Permalink
Load shared attributes.adoc if present and use when parsing attribute…
Browse files Browse the repository at this point in the history
…s for a guide (#429)
  • Loading branch information
stianst authored Nov 7, 2023
1 parent 8722913 commit 95019e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/keycloak/webbuilder/Guides.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ private void loadGuides(AsciiDoctor asciiDoctor, File d, GuideCategory category)

Map<String, Integer> guidePriorities = loadPinnedGuides(new File(d, "pinned-guides"));

File sharedAttributesFile = new File(d.getParentFile(), "attributes.adoc");
Map<String, Object> sharedAttributes = sharedAttributesFile.isFile() ? asciiDoctor.parseAttributes(sharedAttributesFile) : Collections.emptyMap();

for (File f: d.listFiles((dir, name) -> name.endsWith(".adoc") && !name.equals("index.adoc"))) {
Map<String, Object> attributes = asciiDoctor.parseAttributes(f);
Map<String, Object> attributes = asciiDoctor.parseAttributes(f, sharedAttributes);

boolean community = "true".equals(attributes.get("community"));
try {
Expand Down

0 comments on commit 95019e7

Please sign in to comment.