dsm-portfolio-plugin 0.0.23 → 0.1.0

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dsm-portfolio-plugin.rb +14 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c86b480024a1632ae0503534005e8fc56f7322e1
4
- data.tar.gz: 741c420feecdd59f6c0e6eb41b103f42c6897aa2
3
+ metadata.gz: 4ebff37fe1013c2e503587f6c6d3187d6240ddcf
4
+ data.tar.gz: aa39ab0051a8bee4225e4f50ab974499b00d680c
5
5
  SHA512:
6
- metadata.gz: 9e807c36351af549c3f4d0a2a6eeb0228400491f29055b3f656bf71537af43e33d98c5da28928a9180025c73f8e17e5f5c701cc700288c6fa4a74e7158a2ac52
7
- data.tar.gz: ac666cdd9acb68f10d91e435119fdae1225e263d5e9843dda50d42495f06e2b9f678df278404a1e2e47fbd8880d1fa497740a8f6e15c99b3b77cd22419608428
6
+ metadata.gz: ab41647481ac871085868dc17795fe9ed65fb95a6918f3ff8b2e8178eb86267fcf720a3e078d6693b0955e1adf852905c28495b50fed0711ef6fe5c123f0b0ac
7
+ data.tar.gz: b0a27f295cdf1817ec26d676c2e07f1b6c20792b91cf9f10c06773bebc4b5507809093ecdc2b2688934520d79d4425e88675945902fe4fe036aa5bd40d168e07
@@ -32,12 +32,14 @@ module Jekyll
32
32
  name = title.gsub(' ', '-').downcase
33
33
 
34
34
  # Fill task from data file.
35
- post_types_data_file = "post-types"
35
+ post_types_data_file = "project-post-types"
36
36
 
37
37
  # Initialise the site object from configuration (to access data files)
38
- site = Jekyll::Site.new(options)
39
-
40
- puts (site.site_data).to_json
38
+ config_options = configuration_from_options({})
39
+ site = Jekyll::Site.new(config_options)
40
+ site.read
41
+
42
+ post_types = site.site_data[post_types_data_file]
41
43
 
42
44
  if post_types.size > 0
43
45
  # Make subdirectory.
@@ -49,15 +51,17 @@ module Jekyll
49
51
  # For every post-type in subfolder...
50
52
  post_types.each do |post_type|
51
53
  # Format file path.
52
- post_path = file_name(name, post_type.post_type, ext, date)
53
-
54
+ post_path = file_name(name, post_type['post_type'], ext, date)
55
+
54
56
  raise ArgumentError.new("A post already exists at ./#{post_path}") if File.exist?(post_path) and !options["force"]
55
57
 
56
58
  # Create file.
57
- File.open(post_path, "w") do |f|
58
- # Fill it with appropriate front-matter.
59
- f.puts(front_matter(post_type.post_type, title))
60
- end
59
+ IO.copy_stream("_layouts/examples/#{post_type['template_file']}", post_path)
60
+
61
+ # File.open(post_path, "w") do |f|
62
+ # # Fill it with appropriate front-matter.
63
+ # f.puts(front_matter(post_type[:post_type], title))
64
+ # end
61
65
  end
62
66
 
63
67
  puts "New posts created at ./_posts/#{date.strftime('%Y-%m-%d')}-#{name}.\n"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsm-portfolio-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Hills