scms 4.4.3 → 4.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/scms/scms-pageoptions.rb +1 -1
- data/lib/scms/scms-utils.rb +5 -5
- data/lib/scms/version.rb +1 -1
- data/lib/scms.rb +16 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGY2OWVjNzNiZGJlNWUzZWI4NTA4ZjI3NGVkZDU2YzQ2YjE4ZDI1ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjNlYzliNzgwMDVjOWU4MjE5Y2Q5Y2UyOWUwMjljNjI4MGNhMzc3Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmVmOTkxMDk5NGZjNTg0M2JlZjRjY2M4MzhhYmU4ZjQyMDk3OTVlNGFlNmNk
|
10
|
+
ZTBiYjE3ZDIzYjI3YmFiYjY2MzcxZDkwNDRjMDNmZDBmZTIxYjczNjFlYjBk
|
11
|
+
NTNkNDNkNDE5OGFlYWFhNGRjMTUwYmY4OWMxY2NkYmM1NmRhN2U=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGZmYWRkMjM5NjdmMmE1MDhmMjAzMDI1ZTNjY2FjNzE3MDM2Mjk0MGRhNmY5
|
14
|
+
YzI5ODVlZDUxNDllODc3YzFlNzgwM2NkMTlkOGIxNzRiYTg0MjFmMjlhODc0
|
15
|
+
OGYxMTk4MTBmZmQ0NDllZjRiOGFlMGVhZTcwMTA2YzZiNWFiYWM=
|
data/lib/scms/scms-utils.rb
CHANGED
@@ -22,12 +22,12 @@ module ScmsUtils
|
|
22
22
|
def ScmsUtils.readyaml(yamlpath)
|
23
23
|
config = nil
|
24
24
|
if File.exist?(yamlpath)
|
25
|
-
tree = File.read(yamlpath)
|
25
|
+
#tree = File.read(yamlpath)
|
26
26
|
begin
|
27
|
-
myconfig = ERB.new(tree).result()
|
28
|
-
#puts "Conf = #{myconfig}"
|
29
|
-
config = YAML.load(myconfig)
|
30
|
-
|
27
|
+
# myconfig = ERB.new(tree).result()
|
28
|
+
# puts "Conf = #{myconfig}"
|
29
|
+
# config = YAML.load(myconfig)
|
30
|
+
config = YAML.load_file(yamlpath)
|
31
31
|
rescue Exception => e
|
32
32
|
ScmsUtils.errLog("Error Loading _config.yml (check there are no tabs in the file)")
|
33
33
|
ScmsUtils.log("Yaml: #{ScmsUtils.uriEncode("file:///#{yamlpath}")}")
|
data/lib/scms/version.rb
CHANGED
data/lib/scms.rb
CHANGED
@@ -51,7 +51,6 @@ module Scms
|
|
51
51
|
ScmsUtils.writelog("type NUL > #{bootstrap}", website)
|
52
52
|
end
|
53
53
|
end
|
54
|
-
ScmsUtils.log("Generating pages")
|
55
54
|
Scms.generatePages(website, settings, options)
|
56
55
|
else
|
57
56
|
ScmsUtils.errLog("Config is empty")
|
@@ -71,6 +70,7 @@ module Scms
|
|
71
70
|
|
72
71
|
private
|
73
72
|
def Scms.generatePagesFromFolder(website, settings, options)
|
73
|
+
ScmsUtils.log("Generating from _pages folder")
|
74
74
|
pagesFolder = File.join(website, "_pages")
|
75
75
|
Dir.glob("#{pagesFolder}/**/*/").each do |pageFolder|
|
76
76
|
pagename = File.basename(pageFolder, ".*")
|
@@ -110,20 +110,28 @@ module Scms
|
|
110
110
|
private
|
111
111
|
def Scms.generatePagesFromSettings(website, settings, options)
|
112
112
|
if settings["pages"] != nil
|
113
|
-
ScmsUtils.log("
|
113
|
+
ScmsUtils.log("Generating from pages from config")
|
114
114
|
settings["pages"].each do |pagedata|
|
115
115
|
if pagedata != nil
|
116
116
|
pagedata.each do |pageOptions|
|
117
|
+
|
117
118
|
pagename = pageOptions[0]
|
118
119
|
pageconfig = pageOptions[1]
|
120
|
+
settingsViews = pageconfig['views']
|
119
121
|
|
120
122
|
pageOptions = PageOptions.new(pagename, website, pageconfig, settings)
|
121
|
-
|
122
|
-
|
123
|
-
# Dont save a page if no views have been defined (so the config
|
124
|
-
|
123
|
+
|
124
|
+
views = Scms.getSettingsViews(settingsViews, website, pageOptions, options)
|
125
|
+
# Dont save a page if no views have been defined (so the config can have pages for nav building)
|
126
|
+
if views.length < 1
|
127
|
+
#ScmsUtils.log("No views specified for: #{pagename}")
|
128
|
+
#puts "#{pageconfig}"
|
129
|
+
break
|
130
|
+
end
|
125
131
|
Scms.savePage(settings, website, pageOptions, views, options)
|
126
132
|
end
|
133
|
+
else
|
134
|
+
ScmsUtils.errLog("No pagedata")
|
127
135
|
end
|
128
136
|
end
|
129
137
|
end
|
@@ -144,6 +152,8 @@ module Scms
|
|
144
152
|
viewmodel = Scms.getViewModel(viewname, viewpath, website, pageOptions, options, viewData)
|
145
153
|
views[viewname] = Scms.includeView(viewpath, viewmodel)
|
146
154
|
end
|
155
|
+
else
|
156
|
+
#puts "No settingsViews"
|
147
157
|
end
|
148
158
|
return views
|
149
159
|
end
|