jekyll-import 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll-import/importers/wordpress.rb +2 -2
  3. data/lib/jekyll-import/importers/wordpressdotcom.rb +1 -0
  4. data/lib/jekyll-import/version.rb +1 -1
  5. metadata +3 -96
  6. data/.gitignore +0 -21
  7. data/.travis.yml +0 -14
  8. data/Gemfile +0 -2
  9. data/History.markdown +0 -135
  10. data/Rakefile +0 -209
  11. data/jekyll-import.gemspec +0 -60
  12. data/script/bootstrap +0 -3
  13. data/script/cibuild +0 -3
  14. data/site/.gitignore +0 -4
  15. data/site/CNAME +0 -1
  16. data/site/README +0 -1
  17. data/site/_config.yml +0 -7
  18. data/site/_includes/analytics.html +0 -32
  19. data/site/_includes/docs_contents.html +0 -10
  20. data/site/_includes/docs_contents_mobile.html +0 -14
  21. data/site/_includes/docs_option.html +0 -11
  22. data/site/_includes/docs_ul.html +0 -20
  23. data/site/_includes/footer.html +0 -15
  24. data/site/_includes/header.html +0 -18
  25. data/site/_includes/news_contents.html +0 -23
  26. data/site/_includes/news_contents_mobile.html +0 -11
  27. data/site/_includes/news_item.html +0 -24
  28. data/site/_includes/primary-nav-items.html +0 -14
  29. data/site/_includes/section_nav.html +0 -22
  30. data/site/_includes/top.html +0 -17
  31. data/site/_layouts/default.html +0 -12
  32. data/site/_layouts/docs.html +0 -29
  33. data/site/_layouts/news.html +0 -19
  34. data/site/_layouts/news_item.html +0 -27
  35. data/site/_posts/2013-11-09-jekyll-import-0-1-0-beta4-release.markdown +0 -23
  36. data/site/_posts/2013-11-18-jekyll-import-0-1-0-rc1-released.markdown +0 -17
  37. data/site/_posts/2013-12-17-jekyll-import-0-1-0-released.markdown +0 -67
  38. data/site/_posts/2014-03-16-jekyll-import-0-2-0-released.markdown +0 -16
  39. data/site/_posts/2014-05-23-jekyll-import-0-3-0-released.markdown +0 -22
  40. data/site/_posts/2014-06-29-jekyll-import-0-4-0-released.markdown +0 -19
  41. data/site/css/gridism.css +0 -110
  42. data/site/css/normalize.css +0 -1
  43. data/site/css/pygments.css +0 -70
  44. data/site/css/style.css +0 -945
  45. data/site/docs/behance.md +0 -20
  46. data/site/docs/contributing.md +0 -8
  47. data/site/docs/csv.md +0 -37
  48. data/site/docs/drupal6.md +0 -24
  49. data/site/docs/drupal7.md +0 -24
  50. data/site/docs/easyblog.md +0 -25
  51. data/site/docs/enki.md +0 -23
  52. data/site/docs/ghost.md +0 -19
  53. data/site/docs/google_reader.md +0 -19
  54. data/site/docs/history.md +0 -130
  55. data/site/docs/index.md +0 -17
  56. data/site/docs/installation.md +0 -26
  57. data/site/docs/joomla.md +0 -26
  58. data/site/docs/jrnl.md +0 -23
  59. data/site/docs/marley.md +0 -20
  60. data/site/docs/mephisto.md +0 -23
  61. data/site/docs/mt.md +0 -39
  62. data/site/docs/posterous.md +0 -25
  63. data/site/docs/rss.md +0 -19
  64. data/site/docs/s9y.md +0 -19
  65. data/site/docs/textpattern.md +0 -30
  66. data/site/docs/third-party.md +0 -30
  67. data/site/docs/tumblr.md +0 -24
  68. data/site/docs/typo.md +0 -26
  69. data/site/docs/usage.md +0 -29
  70. data/site/docs/wordpress.md +0 -41
  71. data/site/docs/wordpressdotcom.md +0 -47
  72. data/site/favicon.png +0 -0
  73. data/site/feed.xml +0 -36
  74. data/site/img/article-footer.png +0 -0
  75. data/site/img/footer-arrow.png +0 -0
  76. data/site/img/footer-logo.png +0 -0
  77. data/site/img/logo-2x.png +0 -0
  78. data/site/img/octojekyll.png +0 -0
  79. data/site/img/tube.png +0 -0
  80. data/site/img/tube1x.png +0 -0
  81. data/site/index.html +0 -95
  82. data/site/js/modernizr-2.5.3.min.js +0 -4
  83. data/site/news/index.html +0 -10
  84. data/site/news/releases/index.html +0 -10
  85. data/test/helper.rb +0 -50
  86. data/test/test_jrnl_importer.rb +0 -39
  87. data/test/test_mt_importer.rb +0 -104
  88. data/test/test_tumblr_importer.rb +0 -108
  89. data/test/test_util.rb +0 -10
  90. data/test/test_wordpress_importer.rb +0 -9
  91. data/test/test_wordpressdotcom_importer.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cf5aa86194fdb6bdad5d6b80ea34737f92bbf27
4
- data.tar.gz: 56b1abb55373e60f2c5b5cd51c74fec9c3d3fac9
3
+ metadata.gz: 3ea4fc21b7d8bde846159c3822251b2192274fa8
4
+ data.tar.gz: 2ab2c876e9b3e440eba999232d45665f0ba7ff7d
5
5
  SHA512:
6
- metadata.gz: 29d66c08763920e7a6a06d12cd3557d5f86fca0909b39412fb53d0b39886dac88e14d76c7ac9cc3dfd84296d3ef4644df48fed9315046040a7c9b6e61d20368a
7
- data.tar.gz: 50e2e862522b4f4d60a0497c443627d5218d97454623fdaf5807bf91ef8e011361a037ca63efbe639ef53ae44e25b78bcbf11fac8fac3200f51c1a2710f4b137
6
+ metadata.gz: bbbb4b901182d17af3d0ed0432f6443b9051cd9d3976f95108931806c82fc98342218df4a6b3750705269a88b8bce73b4f236763d5e8713d8591366189b73666
7
+ data.tar.gz: 6f6a0fbcf76c5a05908e8e9aba0bc8f9e3a5c9cd832a671b20b6f32d4758f69f94ac96779aa53d0bff8c151a4923a7b32cb582b21d4d173e0456e587c99f237a
@@ -27,7 +27,7 @@ module JekyllImport
27
27
  c.option 'user', '--user USER', 'Database user name (default: "")'
28
28
  c.option 'password', '--password PW', "Database user's password (default: "")"
29
29
  c.option 'host', '--host HOST', 'Database host name (default: "localhost")'
30
- c.option 'table_prefix', '--prefix PREFIX', 'Table prefix name (default: "wp_")'
30
+ c.option 'table_prefix', '--table_prefix PREFIX', 'Table prefix name (default: "wp_")'
31
31
  c.option 'clean_entities', '--clean_entities', 'Whether to clean entities (default: true)'
32
32
  c.option 'comments', '--comments', 'Whether to import comments (default: true)'
33
33
  c.option 'categories', '--categories', 'Whether to import categories (default: true)'
@@ -83,7 +83,7 @@ module JekyllImport
83
83
  :host => opts.fetch('host', 'localhost'),
84
84
  :socket => opts.fetch('socket', ''),
85
85
  :dbname => opts.fetch('dbname', ''),
86
- :table_prefix => opts.fetch('prefix', 'wp_'),
86
+ :table_prefix => opts.fetch('table_prefix', 'wp_'),
87
87
  :clean_entities => opts.fetch('clean_entities', true),
88
88
  :comments => opts.fetch('comments', true),
89
89
  :categories => opts.fetch('categories', true),
@@ -108,6 +108,7 @@ module JekyllImport
108
108
  header = {
109
109
  'layout' => type,
110
110
  'title' => title,
111
+ 'date' => date,
111
112
  'categories' => categories,
112
113
  'tags' => tags,
113
114
  'status' => status,
@@ -1,3 +1,3 @@
1
1
  module JekyllImport
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-30 00:00:00.000000000 Z
11
+ date: 2014-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -298,14 +298,8 @@ extra_rdoc_files:
298
298
  - README.markdown
299
299
  - LICENSE
300
300
  files:
301
- - ".gitignore"
302
- - ".travis.yml"
303
- - Gemfile
304
- - History.markdown
305
301
  - LICENSE
306
302
  - README.markdown
307
- - Rakefile
308
- - jekyll-import.gemspec
309
303
  - lib/jekyll-import.rb
310
304
  - lib/jekyll-import/importer.rb
311
305
  - lib/jekyll-import/importers.rb
@@ -333,86 +327,6 @@ files:
333
327
  - lib/jekyll-import/util.rb
334
328
  - lib/jekyll-import/version.rb
335
329
  - lib/jekyll/commands/import.rb
336
- - script/bootstrap
337
- - script/cibuild
338
- - site/.gitignore
339
- - site/CNAME
340
- - site/README
341
- - site/_config.yml
342
- - site/_includes/analytics.html
343
- - site/_includes/docs_contents.html
344
- - site/_includes/docs_contents_mobile.html
345
- - site/_includes/docs_option.html
346
- - site/_includes/docs_ul.html
347
- - site/_includes/footer.html
348
- - site/_includes/header.html
349
- - site/_includes/news_contents.html
350
- - site/_includes/news_contents_mobile.html
351
- - site/_includes/news_item.html
352
- - site/_includes/primary-nav-items.html
353
- - site/_includes/section_nav.html
354
- - site/_includes/top.html
355
- - site/_layouts/default.html
356
- - site/_layouts/docs.html
357
- - site/_layouts/news.html
358
- - site/_layouts/news_item.html
359
- - site/_posts/2013-11-09-jekyll-import-0-1-0-beta4-release.markdown
360
- - site/_posts/2013-11-18-jekyll-import-0-1-0-rc1-released.markdown
361
- - site/_posts/2013-12-17-jekyll-import-0-1-0-released.markdown
362
- - site/_posts/2014-03-16-jekyll-import-0-2-0-released.markdown
363
- - site/_posts/2014-05-23-jekyll-import-0-3-0-released.markdown
364
- - site/_posts/2014-06-29-jekyll-import-0-4-0-released.markdown
365
- - site/css/gridism.css
366
- - site/css/normalize.css
367
- - site/css/pygments.css
368
- - site/css/style.css
369
- - site/docs/behance.md
370
- - site/docs/contributing.md
371
- - site/docs/csv.md
372
- - site/docs/drupal6.md
373
- - site/docs/drupal7.md
374
- - site/docs/easyblog.md
375
- - site/docs/enki.md
376
- - site/docs/ghost.md
377
- - site/docs/google_reader.md
378
- - site/docs/history.md
379
- - site/docs/index.md
380
- - site/docs/installation.md
381
- - site/docs/joomla.md
382
- - site/docs/jrnl.md
383
- - site/docs/marley.md
384
- - site/docs/mephisto.md
385
- - site/docs/mt.md
386
- - site/docs/posterous.md
387
- - site/docs/rss.md
388
- - site/docs/s9y.md
389
- - site/docs/textpattern.md
390
- - site/docs/third-party.md
391
- - site/docs/tumblr.md
392
- - site/docs/typo.md
393
- - site/docs/usage.md
394
- - site/docs/wordpress.md
395
- - site/docs/wordpressdotcom.md
396
- - site/favicon.png
397
- - site/feed.xml
398
- - site/img/article-footer.png
399
- - site/img/footer-arrow.png
400
- - site/img/footer-logo.png
401
- - site/img/logo-2x.png
402
- - site/img/octojekyll.png
403
- - site/img/tube.png
404
- - site/img/tube1x.png
405
- - site/index.html
406
- - site/js/modernizr-2.5.3.min.js
407
- - site/news/index.html
408
- - site/news/releases/index.html
409
- - test/helper.rb
410
- - test/test_jrnl_importer.rb
411
- - test/test_mt_importer.rb
412
- - test/test_tumblr_importer.rb
413
- - test/test_util.rb
414
- - test/test_wordpress_importer.rb
415
- - test/test_wordpressdotcom_importer.rb
416
330
  homepage: http://github.com/jekyll/jekyll-import
417
331
  licenses:
418
332
  - MIT
@@ -438,11 +352,4 @@ rubygems_version: 2.2.2
438
352
  signing_key:
439
353
  specification_version: 2
440
354
  summary: Import command for Jekyll (static site generator).
441
- test_files:
442
- - test/helper.rb
443
- - test/test_jrnl_importer.rb
444
- - test/test_mt_importer.rb
445
- - test/test_tumblr_importer.rb
446
- - test/test_util.rb
447
- - test/test_wordpress_importer.rb
448
- - test/test_wordpressdotcom_importer.rb
355
+ test_files: []
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- coverage
6
- InstalledFiles
7
- lib/bundler/man
8
- pkg
9
- rdoc
10
- spec/reports
11
- test/tmp
12
- test/version_tmp
13
- tmp
14
-
15
- # YARD artifacts
16
- .yardoc
17
- _yardoc
18
- doc/
19
-
20
- .DS_Store
21
- Gemfile.lock
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- language: ruby
2
- install:
3
- - export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
4
- - travis_retry ./script/bootstrap
5
- rvm:
6
- - 2.1
7
- - 2.0
8
- - 1.9.3
9
- script: ./script/cibuild
10
- notifications:
11
- irc: "irc.freenode.org#jekyll"
12
- email:
13
- on_success: never
14
- on_failure: never
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source "https://rubygems.org"
2
- gemspec
data/History.markdown DELETED
@@ -1,135 +0,0 @@
1
- ## HEAD
2
-
3
- ### Major Enhancements
4
-
5
- ### Minor Enhancements
6
-
7
- ### Bug Fixes
8
-
9
- ### Site Enhancements
10
-
11
- ### Development Fixes
12
-
13
- ## 0.4.0 / 2014-06-29
14
-
15
- ### Minor Enhancements
16
-
17
- * Add easyblog importer (#136)
18
- * WordPress: import draft posts into `_drafts` folder (#147)
19
- * Be really permissive about which Jekyll version to use
20
-
21
- ### Bug Fixes
22
-
23
- * Tumblr: Photo posts with multiple photos will now all import (#145)
24
-
25
- ### Site Enhancements
26
-
27
- * Fix table prefix key in WordPress docs. (#150)
28
-
29
- ### Development Fixes
30
-
31
- * Add GitHub `script/*` conventions for easy pick-up. (#146)
32
-
33
- ## 0.3.0 / 2014-05-23
34
-
35
- ### Minor Enhancements
36
-
37
- * Import WordPress.org `author` data as hash (#139)
38
- * Add `socket` option to the WordPress importer (#140)
39
- * Allow the CSV importer to skip writing front matter (#143)
40
- * WordPress.com: Download images locally and update links to them (#134)
41
- * WordPress: Import WP pages as proper Jekyll pages instead of as posts (#137)
42
-
43
- ### Bug Fixes
44
-
45
- * Replace errant `continue` expression with the valid `next` expression (#133)
46
-
47
- ## 0.2.0 / 2014-03-16
48
-
49
- ### Major Enhancements
50
- * Add comments to MovableType importer (#66)
51
- * Support auto-paragraph Wordpress convention (#125)
52
-
53
- ### Minor Enhancements
54
- * Extract author info from wordpress XML files (#131)
55
-
56
- ### Bug Fixes
57
- * Require YAML library in Enki importer (#112)
58
- * Fix !ruby/string:Sequel::SQL::Blob error in MT excerpts (#113)
59
- * Drupal6: Ensure post "tags" is "", never nil (#117)
60
- * Fixes a bug where the Tumblr importer would write posts with `nil`
61
- content (#118)
62
- * Change Drupal7 layout to `post` rather than `default` (#124)
63
- * WordPress: Use explicit `#to_s` when outputting post dates (#129)
64
-
65
- ### Site Enhancements
66
- * Fixed error in quickstart code, added required design changes/reflow (#120)
67
- * Fix example parameter names for Tumblr importer (#122)
68
- * Add note to WordPress installer docs page that indicates what the importer
69
- does and doesn't do. (#127)
70
-
71
- ### Development Fixes
72
- * Bring gemspec into the 2010's (#130)
73
-
74
- ## 0.1.0 / 2013-12-18
75
-
76
- ### Major Enhancements
77
- * Add 'Ghost' importer (#100)
78
- * Add 'Behance' importer (#46, #104)
79
- * Add the optional ability to include images in a posterous migration (#5)
80
- * Posterous archive (unzipped directory) importer added (#12)
81
- * Improve MovableType importer (#13)
82
- * Add an importer for Google Reader blog exports (#36)
83
- * Remove dependency on html2text in the tumblr importer (#33)
84
- * Add the ability to import .jrnl files (#51)
85
- * Handle missing gems a bit more gracefully (#59)
86
-
87
- ### Minor Enhancements
88
- * Add date and redirection pages for blogs imported from Tumblr (#54)
89
- * Various Tumblr Enhancements (#27)
90
- * Adding tags to Typo and forcing their encoding to UTF-8 (#11)
91
- * S9Y Importer: specify data source using --source option (#18)
92
- * Add taxonomy (`tags`) to Drupal6 migration (#15)
93
- * Differentiate between categories and tags in the WordpressDotCom
94
- importer (#31)
95
- * Use tumblr slug for post is available, use that instead (#39, #40)
96
- * Drupal 7 importer should use latest revision of a post (#38)
97
- * Improve the handling of tags in the Drupal 6 importer. Tags with
98
- spaces are handled now and the importer doesn't eat tags anymore. (#42)
99
- * Upgrade to `jekyll ~> 1.3` and `safe_yaml ~> 0.9.7`
100
- * Add license to gemspec (#83)
101
- * Add an `Importer.run` method for easy invocation (#88)
102
-
103
- ### Bug Fixes
104
- * Remove usage of `Hash#at` in Tumblr importer (#14)
105
- * Force encoding of Drupal 6.x titles to UTF-8 (#22)
106
- * Update wordpressdotcom.rb to use its method parameter correctly (#24)
107
- * Use MySQL2 adapter for WordPress importer to fix broken front-matter (#20)
108
- * Fix WordPress import initialize parameters due to new Jekyll setup (#19)
109
- * Fixed misspelling in method name (#17)
110
- * Fix Drupal 7 importer so it compares node ID's properly between `node` and
111
- `field_data_body` tables (#38)
112
- * Fix prefix replacement for Drupal6 (#41)
113
- * Fix an exception when a Movable Type blog did not have additional
114
- entry text (#45)
115
- * Create `_layouts/` before writing refresh.html in Drupal migrators (#48)
116
- * Fix bug where post date in `MT` importer was not imported for older versions
117
- of MT sites (#62)
118
- * Fix interface of importers' `#process` method (#69)
119
- * RSS importer should specify `--source` option (#81)
120
- * Fix fetching of parameters from options hash (#86)
121
- * Drupal6: Fix NoMethodError on untagged post (#93)
122
- * S9Y: Use RSS parser from `rss` package, not the RSS importer (#102)
123
- * Support as much of the current Commander interface as possible (#103)
124
-
125
- ### Site Enhancements
126
- * Add the site (#87)
127
-
128
- ### Development Fixes
129
- * Update usage docs in RSS importer (#35)
130
- * Added initial version of a test case for Tumblr (#43)
131
- * Remove some outdated comments in the Drupal migrators (#50)
132
- * Update the README to be more informative (#52)
133
- * Add comment to Wordpress importer on how to install mysql with
134
- MacPorts (#56)
135
- * Correcting the homepage URL so links from rubygems.org will work (#63)
data/Rakefile DELETED
@@ -1,209 +0,0 @@
1
- # require 'rake/testtask'
2
-
3
- require 'rubygems'
4
- require 'rake'
5
- require 'rdoc'
6
- require 'date'
7
- require 'yaml'
8
-
9
- #############################################################################
10
- #
11
- # Helper functions
12
- #
13
- #############################################################################
14
-
15
- def name
16
- @name ||= Dir['*.gemspec'].first.split('.').first
17
- end
18
-
19
- def version
20
- JekyllImport::VERSION
21
- end
22
-
23
- def gemspec_file
24
- "#{name}.gemspec"
25
- end
26
-
27
- def gem_file
28
- "#{name}-#{version}.gem"
29
- end
30
-
31
- def normalize_bullets(markdown)
32
- markdown.gsub(/\s{2}\*{1}/, "-")
33
- end
34
-
35
- def linkify_prs(markdown)
36
- markdown.gsub(/#(\d+)/) do |word|
37
- "[#{word}]({{ site.repository }}/issues/#{word.delete("#")})"
38
- end
39
- end
40
-
41
- def linkify_users(markdown)
42
- markdown.gsub(/(@\w+)/) do |username|
43
- "[#{username}](https://github.com/#{username.delete("@")})"
44
- end
45
- end
46
-
47
- def linkify(markdown)
48
- linkify_users(linkify_prs(markdown))
49
- end
50
-
51
- def liquid_escape(markdown)
52
- markdown.gsub(/(`{[{%].+[}%]}`)/, "{% raw %}\\1{% endraw %}")
53
- end
54
-
55
- def remove_head_from_history(markdown)
56
- index = markdown =~ /^##\s+\d+\.\d+\.\d+/
57
- markdown[index..-1]
58
- end
59
-
60
- def converted_history(markdown)
61
- remove_head_from_history(liquid_escape(linkify(normalize_bullets(markdown))))
62
- end
63
-
64
- #############################################################################
65
- #
66
- # Standard tasks
67
- #
68
- #############################################################################
69
-
70
- task :default => :test
71
-
72
- require 'rake/testtask'
73
- Rake::TestTask.new(:test) do |test|
74
- test.libs << 'lib' << 'test'
75
- test.pattern = 'test/**/test_*.rb'
76
- test.verbose = true
77
- end
78
-
79
- require 'rdoc/task'
80
- Rake::RDocTask.new do |rdoc|
81
- rdoc.rdoc_dir = 'rdoc'
82
- rdoc.title = "#{name} #{version}"
83
- rdoc.rdoc_files.include('README*')
84
- rdoc.rdoc_files.include('lib/**/*.rb')
85
- end
86
-
87
- desc "Open an irb session preloaded with this library"
88
- task :console do
89
- sh "irb -rubygems -r ./lib/#{name}.rb"
90
- end
91
-
92
- #############################################################################
93
- #
94
- # Site tasks - http://import.jekyllrb.com
95
- #
96
- #############################################################################
97
-
98
- namespace :site do
99
- desc "Generate and view the site locally"
100
- task :preview do
101
- require "launchy"
102
-
103
- # Yep, it's a hack! Wait a few seconds for the Jekyll site to generate and
104
- # then open it in a browser. Someday we can do better than this, I hope.
105
- Thread.new do
106
- sleep 4
107
- puts "Opening in browser..."
108
- Launchy.open("http://localhost:4000")
109
- end
110
-
111
- # Generate the site in server mode.
112
- puts "Running Jekyll..."
113
- Dir.chdir("site") do
114
- sh "jekyll serve --watch"
115
- end
116
- end
117
-
118
- desc "Update normalize.css library to the latest version and minify"
119
- task :update_normalize_css do
120
- Dir.chdir("site/css") do
121
- sh 'curl "http://necolas.github.io/normalize.css/latest/normalize.css" -o "normalize.scss"'
122
- sh 'sass "normalize.scss":"normalize.css" --style compressed'
123
- sh 'rm "normalize.scss"'
124
- end
125
- end
126
-
127
- desc "Commit the local site to the gh-pages branch and publish to GitHub Pages"
128
- task :publish => [:history] do
129
- sh "git subtree push --prefix site origin gh-pages"
130
- end
131
-
132
- desc "Create a nicely formatted history page for the jekyll site based on the repo history."
133
- task :history do
134
- if File.exist?("History.markdown")
135
- history_file = File.read("History.markdown")
136
- front_matter = {
137
- "layout" => "docs",
138
- "title" => "History",
139
- "permalink" => "/docs/history/",
140
- "prev_section" => "contributing"
141
- }
142
- Dir.chdir('site/docs/') do
143
- File.open("history.md", "w") do |file|
144
- file.write("#{front_matter.to_yaml}---\n\n")
145
- file.write(converted_history(history_file))
146
- end
147
- end
148
- unless `git diff site/docs/history.md`.strip.empty?
149
- sh "git add site/docs/history.md"
150
- sh "git commit -m 'Updated generated history.md file in the site.'"
151
- else
152
- puts "No updates to commit at this time. Skipping..."
153
- end
154
- else
155
- abort "You seem to have misplaced your History.markdown file. I can haz?"
156
- end
157
- end
158
-
159
- namespace :releases do
160
- desc "Create new release post"
161
- task :new, :version do |t, args|
162
- raise "Specify a version: rake site:releases:new['1.2.3']" unless args.version
163
- today = Time.new.strftime('%Y-%m-%d')
164
- release = args.version.to_s
165
- filename = "site/_posts/#{today}-jekyll-import-#{release.split('.').join('-')}-released.markdown"
166
-
167
- File.open(filename, "wb") do |post|
168
- post.puts("---")
169
- post.puts("layout: news_item")
170
- post.puts("title: 'jekyll-import #{release} Released'")
171
- post.puts("date: #{Time.new.strftime('%Y-%m-%d %H:%M:%S %z')}")
172
- post.puts("author: ")
173
- post.puts("version: #{version}")
174
- post.puts("categories: [release]")
175
- post.puts("---")
176
- post.puts
177
- post.puts
178
- end
179
-
180
- puts "Created #{filename}"
181
- end
182
- end
183
- end
184
-
185
- #############################################################################
186
- #
187
- # Packaging tasks
188
- #
189
- #############################################################################
190
-
191
- desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
192
- task :release => :build do
193
- unless `git branch` =~ /^\* master$/
194
- puts "You must be on the master branch to release!"
195
- exit!
196
- end
197
- sh "git commit --allow-empty -a -m 'Release #{version}'"
198
- sh "git tag v#{version}"
199
- sh "git push origin master"
200
- sh "git push origin v#{version}"
201
- sh "gem push pkg/#{name}-#{version}.gem"
202
- end
203
-
204
- desc "Build #{gem_file} into the pkg directory"
205
- task :build do
206
- sh "mkdir -p pkg"
207
- sh "gem build #{gemspec_file}"
208
- sh "mv #{gem_file} pkg"
209
- end