scms 1.9.5 → 1.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/blank-template/_templates/skin.erb.html +13 -17
- data/lib/scms.rb +29 -44
- data/lib/scms/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef0303045a52ddd8fcd7999b9904b1d9149fa47d
|
4
|
+
data.tar.gz: aad39bc24d3458379629a8e9e8706eff9c23ff90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48b720247e9f72f87b223c6c8630f70b0e25957e74148d99f65c547fa2df939257c989eaa21cb749be651e377bf4a9859899868760d2a6ef4eb456e20df4159b
|
7
|
+
data.tar.gz: b880bda1b8863d08bcd5f4d1b0e9e941151db2549b8a6275a7d1471ba9c02a1b80660a432de9421c4442c9ec39cedb4641f1120a66a9f2f3b12e767c451a32ce
|
@@ -37,23 +37,19 @@
|
|
37
37
|
<div class="nav-collapse collapse">
|
38
38
|
<ul class="nav">
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
<li><a href='<%= link.attr("href") %>' class='<%=isActive(link.attr("href"))%> <%= link.attr("class") %>'>
|
54
|
-
<%= link.content %>
|
55
|
-
</a></li>
|
56
|
-
<% end %>
|
40
|
+
<%
|
41
|
+
@currentpagename = data.pagename
|
42
|
+
def isActive(pagename)
|
43
|
+
return active = "active" if @currentpagename == pagename
|
44
|
+
end
|
45
|
+
data.navigation.each do |nav|
|
46
|
+
%>
|
47
|
+
<li class='<%=isActive(nav[:name])%>'>
|
48
|
+
<a href='<%= nav[:url] %>'>
|
49
|
+
<%= nav[:name] %>
|
50
|
+
</a>
|
51
|
+
</li>
|
52
|
+
<% end %>
|
57
53
|
|
58
54
|
<li class="dropdown">
|
59
55
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
|
data/lib/scms.rb
CHANGED
@@ -105,24 +105,35 @@ module Scms
|
|
105
105
|
def Scms.parsepages(scripts, stylesheets, bundles)
|
106
106
|
# build views from templates
|
107
107
|
@template = $settings["template"]
|
108
|
+
|
108
109
|
if $settings["pages"] != nil
|
110
|
+
# Build navigation
|
111
|
+
navigation = Array.new
|
112
|
+
$settings["pages"].each do |page|
|
113
|
+
if page != nil
|
114
|
+
page.each do |pageoptions|
|
115
|
+
pagename = pageoptions[0]
|
116
|
+
pageconfig = pageoptions[1]
|
117
|
+
pageurl = pageconfig["generate"]
|
118
|
+
navigation.push({:name => pagename, :url => pageurl}) unless pageconfig["navigation"] == false
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
109
123
|
ScmsUtils.log("Compiling Pages:")
|
110
124
|
$settings["pages"].each do |page|
|
111
125
|
if page != nil
|
112
|
-
page.each do |
|
113
|
-
|
114
|
-
pageconfig =
|
115
|
-
|
116
|
-
|
126
|
+
page.each do |pageoptions|
|
127
|
+
pagename = pageoptions[0]
|
128
|
+
pageconfig = pageoptions[1]
|
129
|
+
pageurl = pageconfig["generate"]
|
130
|
+
ScmsUtils.successLog("#{pageurl}")
|
117
131
|
if pageconfig["template"] == nil
|
118
132
|
skin = @template
|
119
133
|
else
|
120
134
|
skin = pageconfig["template"]
|
121
135
|
end
|
122
136
|
|
123
|
-
page = pageconfig["generate"]
|
124
|
-
ScmsUtils.successLog("#{page}")
|
125
|
-
|
126
137
|
resource = Hash.new
|
127
138
|
if pageconfig["resource"] != nil
|
128
139
|
resourcepath = File.join($website, pageconfig["resource"])
|
@@ -194,14 +205,16 @@ module Scms
|
|
194
205
|
end
|
195
206
|
#ScmsUtils.log( "view = #{view[0]} - #{view[1]}" )
|
196
207
|
end
|
197
|
-
|
208
|
+
|
198
209
|
monkeyhook = "";
|
199
210
|
if @mode == "cms"
|
200
211
|
monkeyhook = "<script src='scripts/air-monkey-hook.js'></script>"
|
201
212
|
end
|
202
213
|
|
203
214
|
hash = {
|
204
|
-
:page =>
|
215
|
+
:page => pageurl,
|
216
|
+
:pagename => pagename,
|
217
|
+
:pageurl => pageurl,
|
205
218
|
:views => views,
|
206
219
|
:resource => resource,
|
207
220
|
:config => pageconfig,
|
@@ -209,7 +222,8 @@ module Scms
|
|
209
222
|
:stylesheets => stylesheets,
|
210
223
|
:bundles => bundles,
|
211
224
|
:sitedir => $website,
|
212
|
-
:monkeyhook => monkeyhook
|
225
|
+
:monkeyhook => monkeyhook,
|
226
|
+
:navigation => navigation
|
213
227
|
}
|
214
228
|
|
215
229
|
erb = File.join($website, skin)
|
@@ -282,8 +296,8 @@ module Scms
|
|
282
296
|
begin
|
283
297
|
result = ERB.new(template).result(data.instance_eval { binding })
|
284
298
|
rescue Exception => e
|
285
|
-
ScmsUtils.errLog("
|
286
|
-
ScmsUtils.log( "
|
299
|
+
ScmsUtils.errLog("Critical Error: Could not parse template")
|
300
|
+
ScmsUtils.log( "(if your using resources make sure their not empty)" )
|
287
301
|
ScmsUtils.errLog( e.message )
|
288
302
|
end
|
289
303
|
|
@@ -302,7 +316,8 @@ module Scms
|
|
302
316
|
#config = YAML.load_file(yamlpath)
|
303
317
|
rescue Exception => e
|
304
318
|
ScmsUtils.errLog("Error Loading _config.yml (check there are no tabs in the file)")
|
305
|
-
ScmsUtils.log( "
|
319
|
+
ScmsUtils.log( "Verify your config")
|
320
|
+
ScmsUtils.log( "http://yaml-online-parser.appspot.com/")
|
306
321
|
ScmsUtils.errLog( e.message )
|
307
322
|
ScmsUtils.errLog( e.backtrace.inspect )
|
308
323
|
end
|
@@ -378,34 +393,4 @@ module Scms
|
|
378
393
|
File.rename("config.yml", "_config.yml") if File.exists? File.join($website, "config.yml")
|
379
394
|
File.rename("s3config.yml", "_s3config.yml") if File.exists? File.join($website, "s3config.yml")
|
380
395
|
end
|
381
|
-
|
382
|
-
def Scms.crunch(crunchDir)
|
383
|
-
ScmsUtils.log( "Starting crunching CSS and JavaScript in:\n#{crunchDir}\n\n" )
|
384
|
-
Dir.chdir(crunchDir) do
|
385
|
-
Dir.glob("**/*.{css, js}").each do |asset|
|
386
|
-
#fullFileName = File.basename(asset)
|
387
|
-
#ScmsUtils.log( "Crunching #{fullFileName}" )
|
388
|
-
ext = File.extname(asset)
|
389
|
-
Scms.yuicompress(asset, ext)
|
390
|
-
end
|
391
|
-
end
|
392
|
-
end
|
393
|
-
|
394
|
-
def Scms.yuicompress(asset, ext)
|
395
|
-
if File.exists?(asset)
|
396
|
-
#ScmsUtils.log( " Encoding: #{asset.encoding}" )
|
397
|
-
enc = "--charset utf-8"
|
398
|
-
enc = ""
|
399
|
-
cmd = "java"
|
400
|
-
params = "-jar \"#{File.join(Folders[:tools], "yuicompressor", "yuicompressor-2.4.7.jar")}\" #{enc} --type #{ext.gsub(".","")} \"#{asset}\" -o \"#{asset}\""
|
401
|
-
##Need to check if asset exists
|
402
|
-
if system("#{cmd} #{params}")
|
403
|
-
ScmsUtils.log( "_Crunched #{File.basename(asset)}_" )
|
404
|
-
else
|
405
|
-
ScmsUtils.errLog( "Error crunching: #{asset}" )
|
406
|
-
end
|
407
|
-
else
|
408
|
-
ScmsUtils.errLog( "#{asset} does not exist" )
|
409
|
-
end
|
410
|
-
end
|
411
396
|
end
|
data/lib/scms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Courtenay Probert
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
170
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.0.
|
171
|
+
rubygems_version: 2.0.4
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Create simple static websites, in a jiffy
|