245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
# File 'lib/jekyll-theme-cs50.rb', line 245
def render(context)
super
if @args.length < 1
raise "Too few arguments"
elsif @args.length > 2
raise "Too many arguments: #{@markup}"
end
t1 = CS50::strptime(@args[0])
local = t1.iso8601
path = CS50::format(t1)
if @args.length == 2
t2 = CS50::strptime(@args[1], t1)
if t2 < t1
raise "Invalid interval: #{@markup}"
end
local += "/" + t2.iso8601
path += "/" + CS50::format(t2)
end
"<span data-local='#{local}'>#{local}</span>"
end
|