public static JadeTemplate getTemplate(String filename,String extension) throws IOException { return createTemplate(filename,"", new FileTemplateLoader("", "UTF-8",extension), new JexlExpressionHandler()); }
public long getLastModified(String name) { File templateSource = getFile(name); return templateSource.lastModified(); }
public static JadeTemplate getTemplate(String filename) throws IOException { return createTemplate(filename,"", new FileTemplateLoader("", "UTF-8"), new JexlExpressionHandler()); } public static JadeTemplate getTemplate(String filename,String extension) throws IOException {
@Override public Reader getReader(String name) throws IOException { File templateSource = getFile(name); return new InputStreamReader(new FileInputStream(templateSource), encoding); }
public JadeTemplateEngine(final JBakeConfiguration config, final ContentStore db) { super(config, db); TemplateLoader loader = new FileTemplateLoader(config.getTemplateFolder().getPath() + File.separatorChar, config.getTemplateEncoding()); jadeConfiguration.setTemplateLoader(loader); jadeConfiguration.setMode(Jade4J.Mode.XHTML); jadeConfiguration.setPrettyPrint(true); jadeConfiguration.setFilter(FILTER_CDATA, new CDATAFilter()); jadeConfiguration.setFilter(FILTER_SCRIPT, new JsFilter()); jadeConfiguration.setFilter(FILTER_STYLE, new CssFilter()); jadeConfiguration.getSharedVariables().put("formatter", new FormatHelper()); }
public long getLastModified(String name) { File templateSource = getFile(name); return templateSource.lastModified(); }
public HomeDashTemplateEngine(String templateRoot) { if (Constants.DEV_MODE) { this.configuration = new JadeConfiguration(); Path resolve = Paths.get(".").resolve("web").resolve("src").resolve("main").resolve("resources").resolve("templates"); this.configuration.setTemplateLoader(new FileTemplateLoader(resolve.toString() + "/", StandardCharsets.UTF_8.name())); } else { this.configuration = new JadeConfiguration(); this.configuration.setTemplateLoader(new HomeDashClassPathTemplateLoader(templateRoot)); } Map<String, Object> shared = new HashMap<>(); shared.put("STATIC_CONFIG", Constants.STATIC_CONFIG); this.configuration.setSharedVariables(shared); }
@Override public Reader getReader(String name) throws IOException { File templateSource = getFile(name); return new InputStreamReader(new FileInputStream(templateSource), encoding); }
public static JadeTemplate getTemplate(String filename) throws IOException { return createTemplate(filename,"", new FileTemplateLoader("", "UTF-8"), new JexlExpressionHandler()); } public static JadeTemplate getTemplate(String filename,String extension) throws IOException {
public static JadeTemplate getTemplate(String filename,String extension) throws IOException { return createTemplate(filename,"", new FileTemplateLoader("", "UTF-8",extension), new JexlExpressionHandler()); }
private void init() { TemplateLoader templateLoader = null; String templatePath = _config.get("view.jade.templates", "classpath:/templates"); if (templatePath.startsWith("classpath:")) { String root = templatePath.substring("classpath:".length()); templateLoader = new ClasspathTemplateLoader(root); } else { templateLoader = new FileTemplateLoader(templatePath, "UTF-8"); } _jadeConfig = new JadeConfiguration(); _jadeConfig.setTemplateLoader(templateLoader); }
public JadeTemplateEngine(final JBakeConfiguration config, final ContentStore db) { super(config, db); TemplateLoader loader = new FileTemplateLoader(config.getTemplateFolder().getPath() + File.separatorChar, config.getTemplateEncoding()); jadeConfiguration.setTemplateLoader(loader); jadeConfiguration.setMode(Jade4J.Mode.XHTML); jadeConfiguration.setPrettyPrint(true); jadeConfiguration.setFilter(FILTER_CDATA, new CDATAFilter()); jadeConfiguration.setFilter(FILTER_SCRIPT, new JsFilter()); jadeConfiguration.setFilter(FILTER_STYLE, new CssFilter()); jadeConfiguration.getSharedVariables().put("formatter", new FormatHelper()); }