Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit.

  • Loading branch information...
commit db8783de94ff9265621f59843723fa7cc021a39e 0 parents
@jaredhanson authored
Showing with 77 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +15 −0 .npmignore
  3. +28 −0 lib/index.js
  4. +29 −0 package.json
5 .gitignore
@@ -0,0 +1,5 @@
+# Mac OS X
+.DS_Store
+# Node.js
+node_modules
+npm-debug.log
15 .npmignore
@@ -0,0 +1,15 @@
+# Project
+README.md
+Makefile
+docs/
+examples/
+test/
+
+# Mac OS X
+.DS_Store
+# Node.js
+.npmignore
+node_modules/
+npm-debug.log
+# Git
+.git*
28 lib/index.js
@@ -0,0 +1,28 @@
+// http://www.robotstxt.org/robotstxt.html
+
+exports = module.exports = function(host) {
+ // strip trailing slash
+ if ('/' == host[host.length - 1]) {
+ host = host.slice(0, -1);
+ }
+
+ return function robots(site, pages) {
+ site.page('/robots.txt', function(page, next) {
+ var txt = '';
+ txt += 'User-agent: *\r\n';
+ txt += 'Disallow:\r\n';
+ txt += '\r\n';
+
+ var paths = Object.keys(pages).sort()
+ , pg;
+ for (var i = 0, len = paths.length; i < len; i++) {
+ pg = pages[paths[i]];
+ if (pg.sitemap) {
+ txt += 'Sitemap: ' + host + pg.path + '\r\n';
+ }
+ }
+
+ page.write(txt);
+ });
+ }
+}
29 package.json
@@ -0,0 +1,29 @@
+{
+ "name": "kerouac-robotstxt",
+ "version": "0.1.0",
+ "description": "robots.txt plugin for Kerouac.",
+ "keywords": ["robots", "robots.txt", "sitemap", "sitemaps"],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jaredhanson/kerouac-robotstxt.git"
+ },
+ "bugs": {
+ "url": "http://github.com/jaredhanson/kerouac-robotstxt/issues"
+ },
+ "author": { "name": "Jared Hanson", "email": "jaredhanson@gmail.com", "url": "http://www.jaredhanson.net/" },
+ "licenses": [ {
+ "type": "MIT",
+ "url": "http://www.opensource.org/licenses/MIT"
+ } ],
+ "main": "./lib",
+ "dependencies": {
+ },
+ "devDependencies": {
+ "mocha": "1.x.x",
+ "should": "1.x.x"
+ },
+ "scripts": {
+ "test": "NODE_PATH=lib node_modules/.bin/mocha"
+ },
+ "engines": { "node": ">= 0.6.0" }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.