1

我希望能够做类似的事情

// be able to replace this section
Map<String, Object> map = new HashMap<>();
map.put("home.template", "resources"); // foo.html and bar.html (foo invoke bar)
Rythm.init(map);
System.out.println(Rythm.render("foo.html", "World"));

// with this section
Rythm.put("foo.html", fooTemplateStr);//dynamically add/replace foo.html to template repository
Rythm.put("bar.html", barTemplateStr);//dynamically add/replace bar.html to template repository
System.out.println(Rythm.render("foo.html", "World"));

我正在构建一个简单的博客引擎,允许用户通过 Web 界面设置/更改模板。但是我需要使用 Rythm 将模板固定在目录或 jar 文件中,我可以动态加载它们吗?

4