Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added function `esc` for use in templates

version 0.3.0
  • Loading branch information...
commit 0d7cd97fba6567150ee129b2aa5d2523480c3aef 1 parent 0141e43
@pvorb authored
View
5 lib/Index.write.js
@@ -1,6 +1,7 @@
var fs = require("fs"),
ejs = require("ejs"),
clone = require("clone"),
+ esc = require("esc"),
append = require("append"),
Index = require("./Index"),
parseDates = require("./parse-dates");
@@ -38,8 +39,8 @@ Index.prototype.write = function(opt, callback) {
// Local copy of prop
var p = clone(prop);
- // Define `hasOwnProperty` shorthand
- p.has = p.hasOwnProperty;
+ // Add function esc
+ p.esc = esc;
// Append the index properties to `p`
p = append(p, index.properties);
View
5 lib/Index.writeTags.js
@@ -1,6 +1,7 @@
var fs = require("fs"),
ejs = require("ejs"),
clone = require("clone"),
+ esc = require("esc"),
Index = require("./Index"),
parseDate = require("./parse-dates");
@@ -29,8 +30,8 @@ Index.prototype.writeTags = function(opt, callback) {
// make local copy
var p = clone(prop);
- // Define `hasOwnProperty` shorthand
- p.has = p.hasOwnProperty;
+ // Add function `esc`
+ p.esc = esc;
// Add the title of the tag to the properties
p.title = tag;
View
5 package.json
@@ -3,7 +3,7 @@
"name": "Index",
"description": "bakes index files, feeds and tag pages for websites",
"tags": [ "ejs", "index", "feed", "tags" ],
- "version": "0.2.0",
+ "version": "0.3.0",
"repository": {
"type": "git",
"url": "git://github.com/pvorb/node-index.git"
@@ -16,10 +16,11 @@
"node": ">=0.4.0"
},
"dependencies": {
- "mongodb": ">=0.9.6-13",
+ "mongodb": ">=0.9.6-16",
"ejs": ">=0.4.3",
"append": ">=0.1.0",
"clone": ">=0.0.1",
+ "esc": ">=0.0.1",
"isodate": ">=0.0.2"
}
}
View
4 test/pub/feed.xml
@@ -1,9 +1,13 @@
/4/normal2.html
+
/1/normal1.html
+
/3/olderdate.html
+
/2/nodate.html
+
View
1  test/tpl/atom.tpl
@@ -1,3 +1,4 @@
<% for (var i = 0; i < __docs.length; i++) { %>
<%= __docs[i]._id %>
+<%= esc(__docs[i].__content) %>
<% } %>
View
2  test/tpl/index.tpl
@@ -1,4 +1,4 @@
-<% if (has('title')) { %>
+<% if (locals.title) { %>
<%= title %> ~ <%= siteTitle %>
<% } %>
<% for (var i = 0; i < __docs.length; i++) { %>
Please sign in to comment.
Something went wrong with that request. Please try again.