Skip to content

Commit

Permalink
#219 add short code template function to template rendering process
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten Marx committed Sep 4, 2024
1 parent df23c33 commit 9b2aacc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import com.github.thmarx.cms.content.template.functions.list.NodeListFunctionBuilder;
import com.github.thmarx.cms.content.template.functions.navigation.NavigationFunction;
import com.github.thmarx.cms.content.template.functions.query.QueryFunction;
import com.github.thmarx.cms.content.template.functions.shortcode.ShortCodeTemplateFunction;
import com.github.thmarx.cms.content.template.functions.taxonomy.TaxonomyFunction;
import com.github.thmarx.modules.api.ModuleManager;
import java.io.IOException;
Expand Down Expand Up @@ -169,6 +170,7 @@ public String render(final ReadOnlyFile contentFile, final RequestContext contex
);
model.values.put("sections", sections);

model.values.put("shortCodes", createShortCodeFunction(context));
model.values.put("navigation", createNavigationFunction(contentFile, context));
model.values.put("nodeList", createNodeListFunction(contentFile, context));
model.values.put("query", createQueryFunction(contentFile, context));
Expand Down Expand Up @@ -285,4 +287,8 @@ public Map<String, List<Section>> renderSections(final List<ContentNode> section
return sections;
}

private ShortCodeTemplateFunction createShortCodeFunction(RequestContext context) {
return new ShortCodeTemplateFunction(context.get(RenderContext.class).shortCodes());
}

}
2 changes: 1 addition & 1 deletion distribution/build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="distribution" default="distribution" basedir=".">
<property name="cms.version">5.2.0</property>
<property name="cms.version">5.3.0</property>

<property name="thymeleaf.version">v1.2.0</property>

Expand Down

0 comments on commit 9b2aacc

Please sign in to comment.