$ cnpm install blogger2ghost
blogger2ghost
allows you to convert your Blogspot blog content into one compatible with Ghost.
<your blog>/feeds/posts/default?alt=json&max-results=10000
and save it to some file (eg. data.json
)$ npm install blogger2ghost -g
$ blogger2ghost -i data.json > ghost.json
ghost/settings/labs
at your blogImport
controls to import the data to your blogAlternatively you can install and invoke it as a library (ie.
$ npm install blogger2ghost
andnode_modules/blogger2ghost -i data.json
)
Remove tables from posts:
$ blogger2ghost -i data.json > ghost.json --remove-tables
Supply authors for multi-user Ghost:
This will attribute imported posts to existing users, you should first create the users within Ghost.
Create authors.json
file e.g.:
{
"John Smith": { // key should match author name from blogger
"id": 7, // id is arbitrary
"email": "john@example.com" // email is used for lookup, must exist
},
"Jane Doe": {
"id": 8,
"email": "jane@gmail.com"
}
}
Run $ blogger2ghost -i data.json > ghost.json -a authors.json
Download images from Blogger:
This will download all images from existing Blogger posts and place them into a directory ready for upload to Ghost. It will also replace urls with normalised paths that will load from the local content
directory of Ghost.
# 'blogger-images' directory will be created
$ blogger2ghost -i data.json > ghost.json -d blogger-images --download-limit 10
var convert = require('blogger2ghost');
// json to convert goes to first
// options (authors etc.) go to second param
// extension callback as third
convert({...}, {}, function(data, post) {
// manipulate data based on post fields (see blogger data content above)
// you can see data fields available at https://github.com/tryghost/Ghost/wiki/import-format
...
// once you are done with manipulation, return result
return data;
});
to-markdown
to use correct invocationblogger2ghost
is available under MIT. See LICENSE for more details.
Copyright 2014 - 2016 © taobao.org |