Skip to content

Commit

Permalink
Merge pull request #736 from jonbullock/fix/pebble-data-files
Browse files Browse the repository at this point in the history
Fix for data files being referenced from Pebble templates
  • Loading branch information
jonbullock authored Mar 3, 2022
2 parents 7f594f4 + aa11e29 commit 7343470
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
package org.jbake.template.model;

import org.jbake.app.ContentStore;
import org.jbake.app.DocumentList;
import org.jbake.template.ModelExtractor;
import org.jbake.util.DataFileUtil;

import static org.jbake.app.configuration.PropertyList.*;

import java.util.HashMap;
import java.util.Map;
import static org.jbake.app.configuration.PropertyList.*;

public class DataExtractor implements ModelExtractor<DataFileUtil> {

@Override
public DataFileUtil get(ContentStore db, Map model, String key) {
DocumentList dl = new DocumentList();
Map<String, Object> config = (Map<String, Object>) model.get("config");

String defaultDocType = config.get(DATA_FILE_DOCTYPE.getKey()).toString();
String defaultDocType = config.get(DATA_FILE_DOCTYPE.getKey().replace(".", "_")).toString();
DataFileUtil dataUtil = new DataFileUtil(db, defaultDocType);
return dataUtil;
}
Expand Down

0 comments on commit 7343470

Please sign in to comment.