Skip to content

Commit eccd783

Browse files
authored
Document command-line-interface of importers (#507)
Merge pull request 507
1 parent fbd14c8 commit eccd783

36 files changed

+201
-673
lines changed

docs/_config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ collections:
1212
output: true
1313
importers:
1414
output: true
15+
permalink: /docs/:path/
16+
17+
defaults:
18+
- scope:
19+
type: docs
20+
values:
21+
layout: docs
22+
- scope:
23+
type: importers
24+
values:
25+
layout: importer
1526

1627
sass:
1728
style: compressed

docs/_importers/behance.md

-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
---
2-
layout: docs
32
title: Behance
43
importer: true
54
prev_section: usage
65
link_source: behance
76
next_section: blogger
8-
permalink: /docs/behance/
97
---
10-
11-
To import your posts from your [Behance](http://behance.com), generate an API token for your user account and run:
12-
13-
{% highlight bash %}
14-
$ ruby -r rubygems -e 'require "jekyll-import";
15-
JekyllImport::Importers::Behance.run({
16-
"user" => "my_username",
17-
"api_token" => "my_api_token"
18-
})'
19-
{% endhighlight %}
20-
21-
Both `user` and `api_token` are required.

docs/_importers/blogger.md

+5-21
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
---
2-
layout: docs
3-
title: Blogger
42
importer: true
53
prev_section: behance
64
link_source: blogger
75
next_section: csv
8-
permalink: /docs/blogger/
9-
---
10-
11-
To import your posts from your [Blogger](https://www.blogger.com/),
12-
you first have to [export the blog][export-blogger-xml]
13-
to a XML file (`blog-MM-DD-YYYY.xml`),
14-
and run:
15-
{% highlight bash %}
16-
$ ruby -r rubygems -e 'require "jekyll-import";
17-
JekyllImport::Importers::Blogger.run({
18-
"source" => "/path/to/blog-MM-DD-YYYY.xml",
19-
"no-blogger-info" => false, # not to leave blogger-URL info (id and old URL) in the front matter
20-
"replace-internal-link" => false, # replace internal links using the post_url liquid tag.
21-
})'
22-
{% endhighlight %}
6+
prereq_info: |-
7+
To import your posts from Blogger, you have to first [export the blog][export-blogger-xml]
8+
to an XML file (`blog-MM-DD-YYYY.xml`).
239
24-
The only required field is `source`.
25-
The other fields default to their above values.
10+
[export-blogger-xml]: https://support.google.com/blogger/answer/97416 "Export or import your blog - Blogger Help"
11+
---
2612

2713
"Labels" will be included in export as "Tags".
28-
29-
[export-blogger-xml]: https://support.google.com/blogger/answer/97416 "Export or import your blog - Blogger Help"

docs/_importers/csv.md

+3-22
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
---
2-
layout: docs
32
title: CSV
43
prev_section: blogger
54
link_source: csv
65
next_section: drupal6
7-
permalink: /docs/csv/
86
---
97

10-
To import your posts from a CSV file, run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::CSV.run({
15-
"file" => "my_posts.csv"
16-
})'
17-
{% endhighlight %}
18-
198
Your CSV file will be read in with the following columns:
209

2110
1. title
@@ -24,14 +13,6 @@ Your CSV file will be read in with the following columns:
2413
4. published_at
2514
5. filter (e.g. markdown, textile)
2615

27-
If you wish to specify custom front matter for each of your posts, you
28-
can use the `no-front-matter` option to prevent the default front matter
29-
from being written to the imported files:
30-
31-
{% highlight bash %}
32-
$ ruby -r rubygems -e 'require "jekyll-import";
33-
JekyllImport::Importers::CSV.run({
34-
"file" => "my_posts.csv",
35-
"no-front-matter" => true
36-
})'
37-
{% endhighlight %}
16+
If you wish to specify custom front matter for each of your posts, you can use
17+
the `--no-front-matter` option to prevent the default front matter from being
18+
written to the imported files.

docs/_importers/dotclear.md

-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
---
2-
layout: docs
32
title: Dotclear
43
prev_section: csv
54
link_source: dotclear
65
next_section: drupal6
7-
permalink: /docs/dotclear/
86
---
9-
10-
To import your posts from a dotclear file, run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::Dotclear.run({
15-
"datafile" => "2019-....-backup.txt",
16-
"mediafolder" => "path/to/the/media (media.zip inflated)"
17-
})'
18-
{% endhighlight %}

docs/_importers/drupal6.md

+1-34
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,10 @@
11
---
2-
layout: docs
32
title: Drupal 6
43
prev_section: csv
54
link_source: drupal6
65
next_section: drupal7
7-
permalink: /docs/drupal6/
86
---
97

10-
To import your posts from a [Drupal 6](http://drupal.org) installation, run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::Drupal6.run({
15-
"dbname" => "name",
16-
"user" => "myuser",
17-
"password" => "mypassword",
18-
"host" => "myhost",
19-
"prefix" => "mytableprefix",
20-
"types" => ["blog", "story", "article"]
21-
})'
22-
{% endhighlight %}
23-
24-
The only required fields are `dbname` and `user`. `password` defaults to `""`,
25-
`host` defaults to `"localhost"`, and `prefix` defaults to `""`.
26-
278
By default, this will pull in nodes of type `blog`, `story`, and `article`.
289
To specify custom types, you can use the `types` option when you run the
29-
importer:
30-
31-
{% highlight bash %}
32-
$ ruby -r rubygems -e 'require "jekyll-import";
33-
JekyllImport::Importers::Drupal6.run({
34-
"dbname" => "name",
35-
"user" => "myuser",
36-
"password" => "mypassword",
37-
"host" => "myhost",
38-
"prefix" => "mytableprefix",
39-
"types" => ["blog", "post"]
40-
})'
41-
{% endhighlight %}
42-
43-
That will import nodes of type `blog` and `post` only.
10+
importer to select node types.

docs/_importers/drupal7.md

+1-50
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,10 @@
11
---
2-
layout: docs
32
title: Drupal 7
43
prev_section: drupal6
54
link_source: drupal7
65
next_section: drupal8
7-
permalink: /docs/drupal7/
86
---
97

10-
To import your posts from a [Drupal 7](http://drupal.org) installation, run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::Drupal7.run({
15-
"dbname" => "name",
16-
"user" => "myuser",
17-
"password" => "mypassword",
18-
"host" => "myhost",
19-
"prefix" => "mytableprefix",
20-
"types" => ["blog", "story", "article"]
21-
})'
22-
{% endhighlight %}
23-
24-
The only required fields are `dbname` and `user`. `password` defaults to `""`,
25-
`host` defaults to `"localhost"`, and `prefix` defaults to `""`.
26-
278
By default, this will pull in nodes of type `blog`, `story`, and `article`.
289
To specify custom types, you can use the `types` option when you run the
29-
importer:
30-
31-
{% highlight bash %}
32-
$ ruby -r rubygems -e 'require "jekyll-import";
33-
JekyllImport::Importers::Drupal7.run({
34-
"dbname" => "name",
35-
"user" => "myuser",
36-
"password" => "mypassword",
37-
"host" => "myhost",
38-
"prefix" => "mytableprefix",
39-
"types" => ["blog", "post"]
40-
})'
41-
{% endhighlight %}
42-
43-
That will import nodes of type `blog` and `post` only.
44-
45-
The default Drupal 7 expects database to be MySQL. If you want to import posts
46-
from Drupal 7 installation with PostgreSQL define `"engine"` as `"postgresql"`:
47-
48-
{% highlight bash %}
49-
$ ruby -r rubygems -e 'require "jekyll-import";
50-
JekyllImport::Importers::Drupal7.run({
51-
"engine" => "postgresql",
52-
"dbname" => "name",
53-
"user" => "myuser",
54-
"password" => "mypassword",
55-
"host" => "myhost",
56-
"prefix" => "mytableprefix",
57-
"types" => ["blog", "story", "article"]
58-
})'
59-
{% endhighlight %}
10+
importer to select node types.

docs/_importers/drupal8.md

+1-50
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,10 @@
11
---
2-
layout: docs
32
title: Drupal 8
43
prev_section: drupal7
54
link_source: drupal8
65
next_section: easyblog
7-
permalink: /docs/drupal8/
86
---
97

10-
To import your posts from a [Drupal 8](http://drupal.org) installation, run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::Drupal8.run({
15-
"dbname" => "name",
16-
"user" => "myuser",
17-
"password" => "mypassword",
18-
"host" => "myhost",
19-
"prefix" => "mytableprefix",
20-
"types" => ["blog", "story", "article"]
21-
})'
22-
{% endhighlight %}
23-
24-
The only required fields are `dbname` and `user`. `password` defaults to `""`,
25-
`host` defaults to `"localhost"`, and `prefix` defaults to `""`.
26-
278
By default, this will pull in nodes of type `blog`, `story`, and `article`.
289
To specify custom types, you can use the `types` option when you run the
29-
importer:
30-
31-
{% highlight bash %}
32-
$ ruby -r rubygems -e 'require "jekyll-import";
33-
JekyllImport::Importers::Drupal8.run({
34-
"dbname" => "name",
35-
"user" => "myuser",
36-
"password" => "mypassword",
37-
"host" => "myhost",
38-
"prefix" => "mytableprefix",
39-
"types" => ["blog", "post"]
40-
})'
41-
{% endhighlight %}
42-
43-
That will import nodes of type `blog` and `post` only.
44-
45-
The default Drupal 8 expects database to be MySQL. If you want to import posts
46-
from Drupal 8 installation with PostgreSQL define `"engine"` as `"postgresql"`:
47-
48-
{% highlight bash %}
49-
$ ruby -r rubygems -e 'require "jekyll-import";
50-
JekyllImport::Importers::Drupal8.run({
51-
"engine" => "postgresql",
52-
"dbname" => "name",
53-
"user" => "myuser",
54-
"password" => "mypassword",
55-
"host" => "myhost",
56-
"prefix" => "mytableprefix",
57-
"types" => ["blog", "story", "article"]
58-
})'
59-
{% endhighlight %}
10+
importer to select node types.

docs/_importers/easyblog.md

-19
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
---
2-
layout: docs
32
title: EasyBlog
43
prev_section: drupal8
54
link_source: easyblog
65
next_section: enki
7-
permalink: /docs/easyblog/
86
---
9-
10-
To import your posts from a [EasyBlog](http://stackideas.com/easyblog) installation, run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::Easyblog.run({
15-
"dbname" => "name",
16-
"user" => "myuser",
17-
"password" => "mypassword",
18-
"host" => "myhost",
19-
"prefix" => "mytableprefix"
20-
})'
21-
{% endhighlight %}
22-
23-
The only required fields are `dbname` and `user`. `password` defaults to `""`,
24-
`host` defaults to `"localhost"`
25-
`prefix` defaults to `"jos_"`. This will export all articles (in any state). Category and tags will be included in export.

docs/_importers/enki.md

-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
---
2-
layout: docs
3-
title: Enki
42
prev_section: easyblog
53
link_source: enki
64
next_section: ghost
7-
permalink: /docs/enki/
85
---
9-
10-
To import your posts from a [Enki](https://github.com/xaviershay/enki) installation, run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::Enki.run({
15-
"dbname" => "name",
16-
"user" => "myuser",
17-
"password" => "mypassword",
18-
"host" => "myhost"
19-
})'
20-
{% endhighlight %}
21-
22-
The only required fields are `dbname` and `user`. `password` defaults to `""`
23-
and `host` defaults to `"localhost"`.

docs/_importers/ghost.md

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
---
2-
layout: docs
3-
title: Ghost
42
prev_section: enki
53
link_source: ghost
64
next_section: google_reader
7-
permalink: /docs/ghost/
85
---
96

10-
To import your posts from your self-hosted Ghost instance, you first have to download your ghost.db from your server and run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::Ghost.run({
15-
"dbfile" => "/path/to/your/ghost.db"
16-
})'
17-
{% endhighlight %}
18-
19-
There are no required fields. `dbfile` defaults to `"ghost.db"`.
20-
21-
If you have a Ghost backup file, consider using another tool called [jekyll_ghost_importer](https://github.com/eloyesp/jekyll_ghost_importer) to import your content. It is a separate gem and docs can be found at the link provided.
7+
If you have a Ghost backup file, consider using another tool called
8+
[jekyll_ghost_importer](https://github.com/eloyesp/jekyll_ghost_importer) to
9+
import your content. It is a separate gem and docs can be found at the link
10+
provided.

docs/_importers/googlereader.md

-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
---
2-
layout: docs
32
title: Google Reader
43
prev_section: enki
54
link_source: google_reader
65
next_section: joomla
76
permalink: /docs/google_reader/
87
---
9-
10-
To import your posts from a [Google Reader](http://reader.google.com) XML dump file, run:
11-
12-
{% highlight bash %}
13-
$ ruby -r rubygems -e 'require "jekyll-import";
14-
JekyllImport::Importers::GoogleReader.run({
15-
"source" => "my_file.xml"
16-
})'
17-
{% endhighlight %}
18-
19-
The `source` field is required.

0 commit comments

Comments
 (0)