ghost-static
Advanced tools
Comparing version 0.1.3 to 0.1.4
#!/usr/bin/env node | ||
'use strict'; | ||
const scraper = require('website-scraper'), // Version 3+ | ||
const | ||
scraper = require('website-scraper'), | ||
rimraf = require('rimraf'), | ||
@@ -9,3 +10,4 @@ fs = require('fs'), | ||
url = require('url'), | ||
isBinary = require('isbinaryfile'); | ||
isBinary = require('isbinaryfile'), | ||
syncRequest = require('sync-request'); | ||
@@ -61,7 +63,3 @@ /** | ||
urlFilter: url => { | ||
const download = url.indexOf(ghostURL) === 0; | ||
if (download) { | ||
console.log(`Downloading ${url}`); | ||
} | ||
return download; | ||
return url.indexOf(ghostURL) === 0; | ||
}, | ||
@@ -86,3 +84,9 @@ | ||
}) | ||
}, | ||
httpResponseHandler: response => { | ||
console.log(`Downloading ${response.request.href}`); | ||
// Fetch items synchronously to avoid some handlebars-related bugs | ||
const request = syncRequest('GET', response.request.href); | ||
return Promise.resolve(request.getBody('utf8')); | ||
} | ||
@@ -120,2 +124,3 @@ }; | ||
console.log('Done!'); | ||
console.log(`Your static blog is stored in ${path.join(process.cwd(), staticFolder)}`) | ||
}); | ||
@@ -122,0 +127,0 @@ }, 1000); |
{ | ||
"name": "ghost-static", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A tool to convert you Ghost blog to a static website", | ||
@@ -25,4 +25,5 @@ "main": "index.js", | ||
"rimraf": "^2.6.1", | ||
"sync-request": "^4.1.0", | ||
"website-scraper": "^3.1.0" | ||
} | ||
} |
# Ghost-static | ||
Convert your dynamic Ghost blog to a static website. | ||
This tool has been tested for Ghost 0.11. It works with Ghost 1.0.0-rc.1, but the floating-header does not appear. | ||
This tool has been tested for Ghost 0.11 and Ghost 1.0.0-rc.1 | ||
This is a work in progress, some Ghost themes may not work correctly. | ||
@@ -6,0 +7,0 @@ ## Installation |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6509
129
31
5
+ Addedsync-request@^4.1.0
+ Addedasap@2.0.6(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcaseless@0.11.0(transitive)
+ Addedcommand-exists@1.2.9(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedget-port@3.2.0(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-basic@2.5.1(transitive)
+ Addedhttp-response-object@1.1.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpromise@7.3.1(transitive)
+ Addedqs@6.13.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedsync-request@4.1.0(transitive)
+ Addedthen-request@2.2.0(transitive)
+ Addedtypedarray@0.0.6(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedstring_decoder@1.3.0(transitive)