dsm-portfolio-plugin 0.0.9 → 0.0.10
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.
- checksums.yaml +4 -4
- data/lib/dsm-portfolio-plugin.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf056dbff2adb37c50ea2cd0994293e3b68593ac
|
4
|
+
data.tar.gz: b08df746b2fde3ab2de805030a18f3ff99c46609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c15feefcd5aadaa81acf7ff87d3ff9eaa40029ad635c85b07c0d7b9005b76046a2dc291d1e4f9a97d1175717e8c689e9d007bf2265c3cbca1277cd787f45258
|
7
|
+
data.tar.gz: 5b1ecb8c7dc38cfbda48ad47155a9f57d1bcca127d6ab198dcb2db891f6aee7bef026b693ddbc48ebf42dfbe43fe07c45ef22c8752213f57b054194336d59591
|
data/lib/dsm-portfolio-plugin.rb
CHANGED
@@ -37,6 +37,9 @@ module Jekyll
|
|
37
37
|
|
38
38
|
# raise ArgumentError.new("A post already exists at ./#{post_path}") if File.exist?(post_path) and !options["force"]
|
39
39
|
|
40
|
+
# Make subdirectory.
|
41
|
+
FileUtils.mkdir_p directory_name(name, date)
|
42
|
+
|
40
43
|
# For every post-type in subfolder...
|
41
44
|
post_types.each do |post_type|
|
42
45
|
# Format file path.
|
@@ -52,6 +55,10 @@ module Jekyll
|
|
52
55
|
puts "New posts created at ./_posts/#{date.strftime('%Y-%m-%d')}-#{name}.\n"
|
53
56
|
end
|
54
57
|
|
58
|
+
def self.directory_name(name, date)
|
59
|
+
"_posts/#{date.strftime('%Y-%m-%d')}-#{name}"
|
60
|
+
end
|
61
|
+
|
55
62
|
# Returns the filename of the draft, as a String
|
56
63
|
def self.file_name(name, post_type, ext, date)
|
57
64
|
"_posts/#{date.strftime('%Y-%m-%d')}-#{name}/#{post_type}.#{ext}"
|