We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55da70f commit bbaf31eCopy full SHA for bbaf31e
app.rb
@@ -4,6 +4,8 @@
4
require 'wpitjq_generator'
5
require 'haml'
6
7
+default_themes_dir = File.dirname(__FILE__) + "/public/defaults"
8
+
9
get '/' do
10
haml :index
11
end
@@ -13,6 +15,15 @@
13
15
halt "no feed" unless params[:feed]
14
16
halt "no site" unless params[:site]
17
18
+ # check for precalculated themes .. easy way out!
19
+ theme = params[:theme] || ""
20
+ theme = theme.downcase.gsub(" ", "_") + ".js"
21
22
+ if theme && File.exists?("#{default_themes_dir}/#{theme}") then
23
+ return File.new "#{default_themes_dir}/#{theme}"
24
+ end
25
26
+ # else, calculate the js for this theme
27
return Generator.new.for( params[:feed], params[:site] )
28
29
0 commit comments