summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/output/website/createTemplateEngine.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/output/website/createTemplateEngine.js b/lib/output/website/createTemplateEngine.js
index 334ec13..daa591a 100644
--- a/lib/output/website/createTemplateEngine.js
+++ b/lib/output/website/createTemplateEngine.js
@@ -56,6 +56,21 @@ function createTemplateEngine(output, currentFile) {
context: context,
+ globals: {
+ /**
+ Return an article by its path
+
+ @param {String} articlePath
+ @return {Object|undefined}
+ */
+ getArticleByPath: function(articlePath) {
+ var article = summary.getByPath(articlePath);
+ if (!article) return undefined;
+
+ return JSONUtils.encodeSummaryArticle(article);
+ }
+ },
+
filters: defaultFilters.merge({
/**
Translate a sentence
@@ -97,15 +112,6 @@ function createTemplateEngine(output, currentFile) {
contentURL: function(filePath) {
return fileToURL(output, filePath);
- },
-
- /**
- Return an article by its path
- */
- getArticleByPath: function(s) {
- var article = summary.getByPath(s);
- if (!article) return undefined;
- return JSONUtils.encodeSummaryArticle(article);
}
}),