204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
# File 'lib/jekyll-theme-cs50.rb', line 204
def render(context)
super
if @kwargs.key?("ctz")
Jekyll.logger.warn "CS50 warning: no need for @ctz anymore"
end
height = @kwargs["height"] || "480"
components = {
height: height,
hl: "en_US",
mode: @kwargs["mode"] || "AGENDA",
showCalendars: "0",
showDate: "0",
showNav: "0",
showPrint: "0",
showTabs: "0",
showTitle: "0",
showTz: "1",
src: @args[0]
}
src = URI::HTTPS.build(:host => "calendar.google.com", :path => "/calendar/embed", :query => URI.encode_www_form(components))
"<iframe data-calendar='#{src}' #{@kwargs['ctz'] ? 'data-ctz' : ''} style='height: #{height}px;'></iframe>"
end
|