wax_tasks 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f3ee5c37e9bdd609505415066d2e024f0ae2c98
4
- data.tar.gz: c0f9c31e128a27ba5e474df8987c9105317a1a98
3
+ metadata.gz: 823956054c121e807115077ba59f73c6e1a11bd8
4
+ data.tar.gz: c3e1e49fa4f00782b45359857aa102382aa61828
5
5
  SHA512:
6
- metadata.gz: b57d647c1cbc1851d67bf5c1e5bd267a7feb3224d906dbfd8b59ac9e73f4a91645542051447d74e5e31157a0cdcf6d6e665ea1ab715b13ca6a9da993d5d09ecc
7
- data.tar.gz: 65574cf6e3366c037df690884f06b8f2944d1241998c180c46f11964b58af8bd5417da3a0de5ee23b06c629f40539da128057062cb419dfcc34a556bf133cb28
6
+ metadata.gz: 9753ef5e8f16ad101cec17e5282dd8a0f6c374b678a0b3cb4492286002ca2645bfeaecedc87a9d61438d9788cc37b4e734f3181d754f97df8b887476de9c87a2
7
+ data.tar.gz: edef1c3c3c8781a694efa195f31ca8c6724f8c4e8511d7acaecab66037eff1658f5dbb56c9335486bced3e6d84604e10cdd7fde24c7215fc55e71481a8784728
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -7,9 +7,9 @@ namespace :wax do
7
7
  begin
8
8
  $config = YAML.load_file('_config.yml')
9
9
  $argv = ARGV.drop(1)
10
- $argv.each { |a| task a.to_sym do ; end }
11
- rescue
12
- puts "Cannot load _config.yml".magenta
10
+ $argv.each { |a| task a.to_sym do; end }
11
+ rescue StandardError
12
+ puts('Cannot load _config.yml').magenta
13
13
  exit 1
14
14
  end
15
15
  end
@@ -1,34 +1,33 @@
1
1
  require 'jekyll'
2
2
  require 'tmpdir'
3
3
  require 'fileutils'
4
- require 'colorized_string'
5
4
 
6
5
  namespace :wax do
7
6
  desc 'build site with gh-baseurl and publish to gh-pages branch'
8
7
  task :ghbranch => :config do
9
8
  FileUtils.rm_rf('_site')
10
9
 
11
- baseurl = $config['gh-baseurl']
10
+ opts = {
11
+ 'source' => '.',
12
+ 'destination' => '_site',
13
+ 'config' => '_config.yml',
14
+ 'baseurl' => $config['gh-baseurl'],
15
+ 'incremental' => true,
16
+ 'verbose' => true
17
+ }
12
18
 
13
- Jekyll::Site.new(Jekyll.configuration({
14
- "source" => ".",
15
- "destination" => "_site",
16
- "config" => "_config.yml",
17
- "baseurl" => baseurl,
18
- "incremental" => true,
19
- "verbose" => true
20
- })).process
19
+ Jekyll::Site.new(Jekyll.configuration(opts)).process
21
20
 
22
21
  origin = `git config --get remote.origin.url`
23
22
 
24
23
  Dir.mktmpdir do |tmp|
25
- cp_r "_site/.", tmp
24
+ cp_r '_site/.', tmp
26
25
  Dir.chdir tmp
27
26
 
28
- system "git init" # Init the repo.
29
- system "git add . && git commit -m 'Site updated at #{Time.now.utc}'"
30
- system "git remote add origin #{origin}"
31
- system "git push origin master:refs/heads/gh-pages --force"
27
+ system 'git init' # Init the repo.
28
+ system "git add . && git commit -m 'Site updated at " + Time.now.utc + "'"
29
+ system 'git remote add origin ' + origin
30
+ system 'git push origin master:refs/heads/gh-pages --force'
32
31
  end
33
32
  end
34
33
  end
data/lib/tasks/iiif.rake CHANGED
@@ -3,48 +3,48 @@ require 'iiif_s3'
3
3
 
4
4
  namespace :wax do
5
5
  task :iiif => :config do
6
-
7
- FileUtils::mkdir_p 'tiles'
6
+ FileUtils.mkdir_p './_iiif/tiles'
8
7
  imagedata = []
9
8
  id_counter = 0
10
-
11
9
  if $argv.empty?
12
- puts "You must specify one or more collections after 'bundle exec rake wax:iiif' to generate.".magenta
10
+ puts("You must specify one or more collections after 'bundle exec rake wax:iiif' to generate.").magenta
13
11
  exit 1
14
12
  else
13
+ build_opts = {
14
+ :base_url => $config['baseurl'] + '/tiles',
15
+ :output_dir => './_iiif/tiles',
16
+ :tile_scale_factors => [1, 2],
17
+ :verbose => true
18
+ }
15
19
  $argv.each do |a|
16
- dirpath = './_iiif/' + a
17
- unless Dir.exist?(dirpath)
18
- puts ("Source path '" + dirpath + "' does not exist. Exiting.").magenta
19
- exit 1
20
- else
21
- id_counter+=1
22
- imagefiles = Dir[dirpath + "/*"].sort!
20
+ dirpath = './_iiif/source_images/' + a
21
+ if Dir.exist?(dirpath)
22
+ id_counter += 1
23
+ imagefiles = Dir[dirpath + '/*'].sort!
23
24
  counter = 1
24
25
  imagefiles.each do |imagefile|
25
26
  begin
26
- basename = File.basename(imagefile, ".*")
27
- opts = {}
28
- opts[:id] = basename
29
- opts[:is_document] = false
30
- opts[:path] = imagefile
31
- opts[:label] = $config["title"] + " - " + a + " - " + basename
32
- i = IiifS3::ImageRecord.new(opts)
33
- counter = counter + 1
27
+ basename = File.basename(imagefile, '.*').to_s
28
+ record_opts = {
29
+ :id => a + '-' + basename,
30
+ :is_document => false,
31
+ :path => imagefile,
32
+ :label => $config['title'] + ' - ' + a + ' - ' + basename
33
+ }
34
+ i = IiifS3::ImageRecord.new(record_opts)
35
+ counter += 1
34
36
  imagedata.push(i)
35
- rescue
36
- puts ("Failed to convert image " + imagefile + ".").magenta
37
+ rescue StandardError
38
+ puts('Failed to convert image ' + imagefile + '.').magenta
37
39
  exit 1
38
40
  end
39
41
  end
42
+ else
43
+ puts("Source path '" + dirpath + "' does not exist. Exiting.").magenta
44
+ exit 1
40
45
  end
41
46
  end
42
- builder = IiifS3::Builder.new({
43
- :base_url => $config["baseurl"] + "/tiles",
44
- :output_dir => "./tiles",
45
- :tile_scale_factors => [1,2],
46
- :verbose => true
47
- })
47
+ builder = IiifS3::Builder.new(build_opts)
48
48
  builder.load(imagedata)
49
49
  builder.process_data()
50
50
  end
data/lib/tasks/lunr.rake CHANGED
@@ -5,75 +5,66 @@ require 'colorized_string'
5
5
  namespace :wax do
6
6
  desc 'build lunr search index'
7
7
  task :lunr => :config do
8
-
9
- meta = $config['lunr']['meta']
10
- name = $config['lunr']['name'].to_s
11
8
  total_fields = []
12
9
  count = 0
13
-
14
10
  front_matter = "---\nlayout: null\n---"
15
11
  store_string = "\nvar store = ["
16
12
  index_string = "\nvar index = new elasticlunr.Index;\nindex.setRef('lunr_id');\nindex.saveDocument(false);"
17
- if $config['lunr']['multi-language'].to_s == 'true'
18
- index_string += "\nindex.pipeline.remove(elasticlunr.trimmer);" # remove elasticlunr.trimmer if multilanguage is true
13
+ index_string += "\nindex.pipeline.remove(elasticlunr.trimmer);" if $config['lunr_language']
14
+ collections = $config['collections']
15
+ has_content = false
16
+ collections.each do |c|
17
+ if c[1].key?('lunr_index') && c[1]['lunr_index'].key?('fields')
18
+ total_fields.concat c[1]['lunr_index']['fields']
19
+ end
20
+ has_content = true if c[1]['lunr_index']['content']
19
21
  end
20
-
21
- if meta.to_s.empty?
22
- puts "Lunr index parameters are not properly cofigured.".magenta
22
+ total_fields << 'content' if has_content
23
+ if total_fields.uniq.empty?
24
+ puts "Fields are not properly configured.".magenta
23
25
  exit 1
24
26
  else
25
- meta.each { |group| total_fields += group['fields'] }
26
- if total_fields.uniq.empty?
27
- puts "Fields are not properly configured.".magenta
28
- exit 1
29
- else
30
- total_fields.uniq.each do |f|
31
- index_string += "\nindex.addField(" + "'" + f + "'" + "); "
32
- end
33
-
34
- meta.each do |collection|
35
-
36
- dir = collection['dir']
37
- perma = collection['permalink']
38
- fields = collection['fields']
39
-
40
- puts ("Loading pages from " + dir).cyan
41
-
42
- Dir.glob(dir+"/*").each do |md|
27
+ total_fields.uniq.each { |f| index_string += "\nindex.addField(" + "'" + f + "'" + "); " }
28
+ collections.each do |collection|
29
+ name = collection[0]
30
+ collection = collection[1]
31
+ if collection.key?('lunr_index') && collection['lunr_index'].key?('fields')
32
+ dir = collection['directory'] || '_' + name
33
+ fields = collection['lunr_index']['fields']
34
+ puts "Loading pages from #{dir}".cyan
35
+ Dir.glob(dir + '/*.md').each do |md|
43
36
  begin
44
37
  yaml = YAML.load_file(md)
45
- hash = Hash.new
38
+ hash = {}
46
39
  hash['lunr_id'] = count
47
- hash['link'] = "{{ site.baseurl }}" + yaml['permalink']
48
- fields.each { |f| hash[f] = clean(yaml[f].to_s) }
49
- if $config['lunr']['content']
40
+ hash['link'] = '{{ site.baseurl }}' + yaml['permalink']
41
+ fields.uniq.each { |f| hash[f] = yaml[f].to_s }
42
+ if collection['lunr_index']['content']
50
43
  hash['content'] = clean(File.read(md))
51
44
  end
52
45
  index_string += "\nindex.addDoc(" + hash.to_json + "); "
53
46
  store_string += "\n" + hash.to_json + ", "
54
47
  count += 1
55
- rescue
56
- puts ("Cannot load data from markdown pages in " + dir + ".").magenta
48
+ rescue StandardError
49
+ puts "Cannot load data from markdown pages in #{dir}.".magenta
57
50
  exit 1
58
51
  end
59
52
  end
60
53
  end
61
-
62
- store_string = store_string.chomp(", ") + "];"
63
-
64
- Dir.mkdir('js') unless File.exists?('js')
65
- File.open("js/lunr-index.js", 'w') { |file| file.write( front_matter + index_string + store_string ) }
66
- puts ("Writing lunr index to " + "js/lunr-index.js").green
67
54
  end
55
+ store_string = store_string.chomp(', ') + '];'
56
+ Dir.mkdir('js') unless File.exist?('js')
57
+ File.open('js/lunr-index.js', 'w') { |file| file.write(front_matter + index_string + store_string) }
58
+ puts "Writing lunr index to js/lunr-index.js".cyan
68
59
  end
69
60
  end
70
61
  end
71
62
 
72
63
  def clean(str)
73
- str = str.gsub(/\A---(.|\n)*?---/, "") # remove yaml front matter
74
- str = str.gsub(/{%(.*)%}/, "") # remove functional liquid
75
- str = str.gsub(/<\/?[^>]*>/, "") # remove html
76
- str = str.gsub("\\n", "").gsub(/\s+/, ' ') # remove newlines and extra space
77
- str = str.gsub('"',"'").to_s # replace double quotes with single
64
+ str = str.gsub(/\A---(.|\n)*?---/, '') # remove yaml front matter
65
+ str = str.gsub(/{%(.*)%}/, '') # remove functional liquid
66
+ str = str.gsub(/<\/?[^>]*>/, '') # remove html
67
+ str = str.gsub('\\n', '').gsub(/\s+/, ' ') # remove newlines and extra space
68
+ str = str.tr('"', "'").to_s # replace double quotes with single
78
69
  return str
79
70
  end
@@ -1,10 +1,11 @@
1
1
  require 'yaml'
2
2
  require 'csv'
3
+ require 'json'
4
+ require 'colorized_string'
3
5
 
4
6
  namespace :wax do
5
7
  desc 'generate collection md pages from yaml or csv data source'
6
8
  task :pagemaster => :config do
7
-
8
9
  collections = $config['collections']
9
10
  if $argv.empty?
10
11
  puts "You must specify one or more collections after 'bundle exec rake wax:pagemaster' to generate.".magenta
@@ -13,26 +14,22 @@ namespace :wax do
13
14
  $argv.each do |a|
14
15
  collection = collections[a]
15
16
  if collection.nil?
16
- puts ("The collection '" + a + "' does not exist. Check for typos in terminal and _config.yml.").magenta
17
+ puts "The collection '#{a}' does not exist. Check for typos in terminal and _config.yml.".magenta
17
18
  exit 1
18
19
  else
19
-
20
- meta = Hash.new
21
- meta['src'] = '_data/' + File.basename( collection['source'], ".*" ) + ".csv"
22
- meta['layout'] = File.basename( collection['layout'], ".*" )
23
- meta['dir'] = collection['directory']
24
-
25
- $skipped, $completed = 0,0
26
-
27
- unless [ meta['src'], meta['dir'], meta['layout'] ].all?
28
- puts ("Your collection " + a +" is missing one or more of the required parameters (source, directory, layout) in config. please fix and rerun.").magenta
20
+ meta = {}
21
+ meta['src'] = '_data/' + collection['source']
22
+ meta['layout'] = File.basename(collection['layout'], '.*')
23
+ meta['dir'] = collection['directory']
24
+ if [meta['src'], meta['dir'], meta['layout']].all?
25
+ FileUtils.mkdir_p meta['dir']
26
+ data = ingest(meta['src'])
27
+ info = generate_pages(meta, data)
28
+ puts "\n#{info[:completed]} pages were generated to #{meta['dir']} directory.".cyan
29
+ puts "\n#{info[:skipped]} pre-existing items were skipped.".cyan
30
+ else
31
+ puts "\nYour collection '#{a}' is missing one or more of the required parameters (source, directory, layout) in config. please fix and rerun.".magenta
29
32
  exit 1
30
- else
31
- FileUtils::mkdir_p meta['dir']
32
- data = ingest(meta['src'])
33
- generate_pages(meta, data)
34
- puts ("\n" + $completed.to_s + " pages were generated to " + meta['dir'] + " directory.").green
35
- puts ($skipped.to_s + " pre-existing items were skipped.").green
36
33
  end
37
34
  end
38
35
  end
@@ -41,41 +38,46 @@ namespace :wax do
41
38
  end
42
39
 
43
40
  def ingest(src)
44
- begin
45
- data = CSV.read(src, :headers => true, :encoding => 'utf-8')
46
- duplicates = data['pid'].detect{ |i| data.count(i) > 1 }.to_s
47
- unless duplicates.empty?
48
- puts ("Your collection has the following duplicate ids. please fix and rerun.\n").magenta + duplicates +"\n"
49
- exit 1
50
- end
51
- puts ("\nProcessing " + src + "....\n").cyan
52
- return data.map(&:to_hash)
53
- rescue
54
- puts ("Cannot load " + src + ". check for typos and rebuild.").magenta
41
+ src_type = File.extname(src)
42
+ if src_type == '.csv'
43
+ data = CSV.read(src, :headers => true, :encoding => 'utf-8').map(&:to_hash)
44
+ elsif src_type == '.json'
45
+ data = JSON.parse(File.read(src).encode("UTF-8"))
46
+ else
47
+ puts "File type for #{src} must be .csv or .json. Please fix and rerun."
55
48
  exit 1
56
49
  end
50
+ pids = []
51
+ data.each { |d| pids << d['pid'] }
52
+ duplicates = pids.detect { |p| pids.count(p) > 1 } || []
53
+ unless duplicates.empty?
54
+ puts "\nYour collection has the following duplicate ids. please fix and rerun.\n#{duplicates} \n".magenta
55
+ exit 1
56
+ end
57
+ puts "Processing #{src}...."
58
+ return data
59
+ rescue standardError
60
+ puts "Cannot load #{src}. check for typos and rebuild.".magenta
61
+ exit 1
57
62
  end
58
63
 
59
64
  def generate_pages(meta, data)
60
- if $config['permalink'] == 'pretty'
61
- perma_ext = "/"
62
- else
63
- perma_ext = ".html"
64
- end
65
+ perma_ext = '.html'
66
+ perma_ext = '/' if $config['permalink'] == 'pretty'
67
+ info = { :completed => 0, :skipped => 0 }
65
68
  data.each do |item|
66
- begin
67
- pagename = item['pid']
68
- pagepath = meta['dir'] + "/" + pagename + ".md"
69
- if !File.exist?(pagepath)
70
- File.open(pagepath, 'w') { |file| file.write( item.to_yaml.to_s + "permalink: /" + meta['dir'] + "/" + pagename + perma_ext + "\n" + "layout: " + meta['layout'] + "\n---" ) }
71
- $completed+=1
72
- else
73
- puts pagename + ".md already exits. Skipping."
74
- $skipped+=1
75
- end
76
- rescue
77
- puts ($completed.to_s + " pages were generated before failure, most likely a record is missing a valid 'pid' value.").magenta
78
- exit 1
69
+ pagename = item['pid']
70
+ pagepath = meta['dir'] + '/' + pagename + '.md'
71
+ if !File.exist?(pagepath)
72
+ File.open(pagepath, 'w') { |file| file.write(item.to_yaml.to_s + 'permalink: /' + meta['dir'] + '/' + pagename + perma_ext + "\n" + 'layout: ' + meta['layout'] + "\n---") }
73
+ info[:completed] += 1
74
+ else
75
+ puts "#{pagename}.md already exits. Skipping."
76
+ info[:skipped] += 1
79
77
  end
80
78
  end
79
+ return info
80
+ rescue standardError
81
+ puts "#{info[:completed]} pages were generated before failure, most likely a record is missing a valid 'pid' value.".magenta
82
+ exit 1
81
83
  end
@@ -1,33 +1,33 @@
1
1
  require 'jekyll'
2
2
  require 'tmpdir'
3
3
  require 'fileutils'
4
- require 'iiif_s3'
5
4
 
6
5
  namespace :wax do
7
6
  desc 'build site with baseurl and publish to s3 branch'
8
7
  task :s3branch => :config do
9
8
  FileUtils.rm_rf('_site')
10
- baseurl = $config['baseurl']
11
9
 
12
- Jekyll::Site.new(Jekyll.configuration({
13
- "source" => ".",
14
- "destination" => "_site",
15
- "config" => "_config.yml",
16
- "incremental" => true,
17
- "verbose" => true,
18
- "baseurl" => baseurl
19
- })).process
10
+ opts = {
11
+ 'source' => '.',
12
+ 'destination' => '_site',
13
+ 'config' => '_config.yml',
14
+ 'incremental' => true,
15
+ 'verbose' => true,
16
+ 'baseurl' => $config['baseurl']
17
+ }
18
+
19
+ Jekyll::Site.new(Jekyll.configuration(opts)).process
20
20
 
21
21
  origin = `git config --get remote.origin.url`
22
22
 
23
23
  Dir.mktmpdir do |tmp|
24
- cp_r "_site/.", tmp
24
+ cp_r '_site/.', tmp
25
25
  Dir.chdir tmp
26
26
 
27
- system "git init" # Init the repo.
27
+ system 'git init' # Init the repo.
28
28
  system "git add . && git commit -m 'Site updated at #{Time.now.utc}'"
29
- system "git remote add origin #{origin}"
30
- system "git push origin master:refs/heads/s3 --force"
29
+ system 'git remote add origin ' + origin
30
+ system 'git push origin master:refs/heads/s3 --force'
31
31
  end
32
32
  end
33
33
  end
data/lib/tasks/test.rake CHANGED
@@ -1,10 +1,10 @@
1
1
  require 'html-proofer'
2
- require 'iiif_s3'
2
+ require 'colorized_string'
3
3
 
4
4
  namespace :wax do
5
5
  desc 'run htmlproofer, rspec if exists'
6
- task :test do
7
- options = {
6
+ task :test do
7
+ opts = {
8
8
  :check_external_hash => true,
9
9
  :allow_hash_href => true,
10
10
  :check_html => true,
@@ -14,12 +14,10 @@ namespace :wax do
14
14
  :verbose => true
15
15
  }
16
16
  begin
17
- HTMLProofer.check_directory("./_site", options).run
18
- rescue => msg
19
- puts "#{msg}"
20
- end
21
- if File.exist?('.rspec')
22
- sh 'bundle exec rspec'
17
+ HTMLProofer.check_directory('./_site', opts).run
18
+ rescue StandardError
19
+ puts('Failed to run wax:texts. Make sure you are using `bundle exec`.').magenta
23
20
  end
21
+ sh 'bundle exec rspec' if File.exist?('.rspec')
24
22
  end
25
23
  end
metadata CHANGED
@@ -1,29 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wax_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - Marii Nyröp
7
+ - Marii Nyrop
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-12 00:00:00.000000000 Z
11
+ date: 2018-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faker
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
45
  - - "~>"
18
46
  - !ruby/object:Gem::Version
19
- version: '12'
47
+ version: '3.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.52'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.52'
69
+ - !ruby/object:Gem::Dependency
70
+ name: colorize
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.8'
20
76
  type: :runtime
21
77
  prerelease: false
22
78
  version_requirements: !ruby/object:Gem::Requirement
23
79
  requirements:
24
80
  - - "~>"
25
81
  - !ruby/object:Gem::Version
26
- version: '12'
82
+ version: '0.8'
27
83
  - !ruby/object:Gem::Dependency
28
84
  name: html-proofer
29
85
  requirement: !ruby/object:Gem::Requirement
@@ -53,27 +109,41 @@ dependencies:
53
109
  - !ruby/object:Gem::Version
54
110
  version: '0.1'
55
111
  - !ruby/object:Gem::Dependency
56
- name: colorize
112
+ name: jekyll
57
113
  requirement: !ruby/object:Gem::Requirement
58
114
  requirements:
59
115
  - - "~>"
60
116
  - !ruby/object:Gem::Version
61
- version: '0.8'
117
+ version: '3.7'
62
118
  type: :runtime
63
119
  prerelease: false
64
120
  version_requirements: !ruby/object:Gem::Requirement
65
121
  requirements:
66
122
  - - "~>"
67
123
  - !ruby/object:Gem::Version
68
- version: '0.8'
69
- description: 'Rake tasks for minimal exhibition sites with Jekyll. See: minicomp/wax.'
124
+ version: '3.7'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '12.0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '12.0'
139
+ description: Rake tasks for minimal iiif exhibition sites with Jekyll.
70
140
  email:
71
141
  - m.nyrop@columbia.edu
72
142
  executables: []
73
143
  extensions: []
74
144
  extra_rdoc_files: []
75
145
  files:
76
- - README.md
146
+ - Gemfile
77
147
  - lib/tasks/config.rake
78
148
  - lib/tasks/ghbranch.rake
79
149
  - lib/tasks/iiif.rake
@@ -101,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
171
  version: '0'
102
172
  requirements: []
103
173
  rubyforge_project:
104
- rubygems_version: 2.6.9
174
+ rubygems_version: 2.6.14
105
175
  signing_key:
106
176
  specification_version: 4
107
177
  summary: Rake tasks for minimal exhibitions.
data/README.md DELETED
@@ -1,92 +0,0 @@
1
- # wax_tasks [![Gem Version](https://badge.fury.io/rb/wax_tasks.svg)](https://badge.fury.io/rb/wax_tasks) [![Dependency Status](https://gemnasium.com/badges/github.com/mnyrop/wax_tasks.svg)](https://gemnasium.com/github.com/mnyrop/wax_tasks)
2
-
3
- ## [minicomp](https://github.com/minicomp) rake tasks for jekyll [wax](https://minicomp.github.io/wax)
4
-
5
- ### current tasks:
6
-
7
- `wax:pagemaster`: generates markdown pages for jekyll collections from csv or yaml files. (same as [`pagemaster`](https://github.com/mnyrop/pagemaster) gem).
8
-
9
- `wax:iiif`: generates iiif image tiles and associated json for jekyll collections from local jpgs. (uses [`iiif_s3`](https://github.com/cmoa/iiif_s3) gem).
10
-
11
- `wax:ghbranch`: builds your jekyll site and overwrites the `gh-pages` branch to publish your compiled `_site` directory with `gh-baseurl`.
12
-
13
- `wax:s3branch`: builds your jekyll site and overwrites the `s3` branch to publish your compiled `_site` directory with `baseurl`.
14
-
15
- `wax:lunr` builds a Lunrjs search index for your site.
16
-
17
- `wax:test` runs htmlproofer and, if there is an .rspec file, runs your rspec tests.
18
-
19
-
20
- ### set-up:
21
- 1. add the `wax_tasks` gem to your jekyll site's `Gemfile` and install with `bundle install`:
22
- ```
23
- gem 'wax_tasks'
24
- ```
25
- 2. Create a `Rakefile` in the root of your jekyll site and add the following to load the wax_tasks:
26
- ```
27
- spec = Gem::Specification.find_by_name 'wax_tasks'
28
- Dir.glob("#{spec.gem_dir}/lib/tasks/*.rake").each {|r| load r}
29
- ```
30
- 3. Configure the collection information in your site's `_config.yaml`.
31
- ```yaml
32
- # Collection params for wax:pagemaster
33
- collections:
34
- paintings:
35
- output: true
36
- source: paintings-metadata.csv
37
- directory: paintings
38
- layout: painting-page
39
- artists:
40
- output: true
41
- source: artist-data.yaml
42
- directory: artists
43
- layout: author-info-page
44
- ```
45
- 4. If generating a Lunrjs search index, add Lunr Params to `_config.yaml`.
46
- ```bash
47
- # Lunr Search Params (for wax:lunr)
48
- lunr:
49
- content: true
50
- multi-language: true
51
- meta:
52
- - dir: "_projects"
53
- permalink: "/projects"
54
- fields:
55
- - title
56
- - era
57
- - tags
58
- - dir: "_posts"
59
- permalink: "posts"
60
- fields:
61
- - title
62
- - category
63
- - tags
64
- ```
65
- ### to use:
66
- ```bash
67
- $ bundle exec rake wax:<task_name> <option>
68
- ```
69
- #### ex 1: generate md pages for `paintings` and `artists` from data files
70
- ```bash
71
- $ bundle exec rake wax:pagemaster paintings artists
72
- ```
73
- #### ex 2: generate iiif image tiles and associated json for `paintings` from local jpgs:
74
- ```bash
75
- $ bundle exec rake wax:iiif paintings
76
- ```
77
- #### ex 3: publish `_site` to `gh-pages` branch
78
- ```bash
79
- $ bundle exec rake wax:ghbranch
80
- ```
81
- #### ex 4: publish `_site` to `s3` branch
82
- ```bash
83
- $ bundle exec rake wax:s3branch
84
- ```
85
- #### ex 5: (re)generate lunrjs search index
86
- ```bash
87
- $ bundle exec rake wax:lunr
88
- ```
89
- #### ex 6: run CI test(s)
90
- ```bash
91
- $ bundle exec rake wax:test
92
- ```