dsm-portfolio-plugin 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/lib/dsm-portfolio-plugin.rb +5 -14
- 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: 143f2e0e9cf3ed1c2ec287e1c2d8cf5f5e67e706
|
4
|
+
data.tar.gz: 9fbbb2c40e8cdc0b0a080ed93b68b64b946247ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f046ab2cec28845004e1721720cf19d5bc6b1f9e4a82acfcfe2dd2e4f7778f16edd6fda4e6c62575cd5a9e05da85c5eaad2c1947583363cd3423d2c687a78b8
|
7
|
+
data.tar.gz: db2f9c13a821fcc0f067247440ec827609f150a05f4286a2347cf6264d58390c8dba7a1594ad4aa09078317fc3218cbd80dfe94a9ea4de979591d9de5d816f66
|
data/lib/dsm-portfolio-plugin.rb
CHANGED
@@ -57,11 +57,6 @@ module Jekyll
|
|
57
57
|
|
58
58
|
# Create file.
|
59
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
|
65
60
|
end
|
66
61
|
|
67
62
|
puts "New posts created at ./_posts/#{date.strftime('%Y-%m-%d')}-#{name}.\n"
|
@@ -71,18 +66,9 @@ module Jekyll
|
|
71
66
|
"_posts/#{date.strftime('%Y-%m-%d')}-#{name}"
|
72
67
|
end
|
73
68
|
|
74
|
-
# Returns the filename of the draft, as a String
|
75
69
|
def self.file_name(name, post_type, ext, date)
|
76
70
|
"_posts/#{date.strftime('%Y-%m-%d')}-#{name}/#{post_type}.#{ext}"
|
77
71
|
end
|
78
|
-
|
79
|
-
# TODO: Replace this with smart filling from data file and template file.
|
80
|
-
def self.front_matter(layout, title)
|
81
|
-
"---
|
82
|
-
layout: #{layout}
|
83
|
-
title: #{title}
|
84
|
-
---"
|
85
|
-
end
|
86
72
|
end
|
87
73
|
end
|
88
74
|
|
@@ -100,6 +86,7 @@ module Jekyll
|
|
100
86
|
projectFiles = grouping[1]
|
101
87
|
|
102
88
|
projectUrls = {}
|
89
|
+
projectCode = -1
|
103
90
|
|
104
91
|
# Give each file one-off values and assess availability.
|
105
92
|
projectFiles.each do |file|
|
@@ -110,12 +97,16 @@ module Jekyll
|
|
110
97
|
# Give each a type
|
111
98
|
file.data['type'] = file.basename_without_ext
|
112
99
|
|
100
|
+
if !file.data['project_code'].nil?
|
101
|
+
projectCode = file.data['project_code']
|
102
|
+
|
113
103
|
projectUrls[file.data['type']] = file.url
|
114
104
|
end
|
115
105
|
|
116
106
|
# Add singling URLs based on type.
|
117
107
|
projectFiles.each do |file|
|
118
108
|
file.data['project_urls'] = projectUrls
|
109
|
+
file.data['project_code'] = projectCode
|
119
110
|
end
|
120
111
|
end
|
121
112
|
end
|