Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docpad-plugin-cleanurls

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docpad-plugin-cleanurls - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

23

out/cleanurls.plugin.js

@@ -18,12 +18,8 @@ // Generated by CoffeeScript 1.3.3

CleanUrlsPlugin.prototype.parseAfter = function(opts, next) {
CleanUrlsPlugin.prototype.docpadReady = function(opts) {
var database, docpad;
docpad = this.docpad;
database = docpad.getDatabase();
docpad.log('debug', 'Creating clean urls');
database.findAll({
outPath: {
$endsWith: '.html'
}
}).forEach(function(document) {
docpad.log('debug', 'Applying clean urls');
database.on('add change', function(document) {
var documentUrl, relativeBaseUrl, relativeDirUrl;

@@ -33,17 +29,10 @@ documentUrl = document.get('url');

relativeBaseUrl = '/' + document.get('relativeBase');
document.addUrl(relativeBaseUrl);
document.set({
url: relativeBaseUrl
});
document.setUrl(relativeBaseUrl);
}
if (/index\.html$/i.test(documentUrl)) {
relativeDirUrl = '/' + document.get('relativeDirPath');
document.addUrl(relativeDirUrl);
return document.set({
url: relativeDirUrl
});
return document.setUrl(relativeDirUrl);
}
});
docpad.log('debug', 'Created clean urls');
return typeof next === "function" ? next() : void 0;
return docpad.log('debug', 'Applied clean urls');
};

@@ -50,0 +39,0 @@

@@ -17,7 +17,7 @@ // Generated by CoffeeScript 1.3.3

MyTester.prototype.testServer = function(next) {
var expect, fs, request, tester;
var expect, fsUtil, request, tester;
tester = this;
expect = testers.expect;
request = testers.request;
fs = require('fs');
fsUtil = require('fs');
MyTester.__super__.testServer.apply(this, arguments);

@@ -30,10 +30,14 @@ return this.suite('cleanurls', function(suite, test) {

return request("" + baseUrl + "/welcome.html", function(err, response, actual) {
var actualStr;
if (err) {
throw err;
return done(err);
}
return fs.readFile("" + outExpectedPath + "/welcome.html", function(err, expected) {
actualStr = actual.toString();
return fsUtil.readFile("" + outExpectedPath + "/welcome.html", function(err, expected) {
var expectedStr;
if (err) {
throw err;
return done(err);
}
expect(actual.toString()).to.equal(expected.toString());
expectedStr = expected.toString();
expect(actualStr, expectedStr);
return done();

@@ -40,0 +44,0 @@ });

{
"name": "docpad-plugin-cleanurls",
"version": "2.0.1",
"version": "2.0.2",
"description": "Adds support for Clean Urls to DocPad",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/bevry/docpad-extras",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc