Plugins: Allow alerts.rb To Process Markdown

This commit is contained in:
David A. Harding 2015-07-06 11:22:18 -04:00
parent 8c3852e230
commit bd21ecf3c9
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7

View file

@ -26,6 +26,7 @@ module Jekyll
@base = base
@dir = '/'+dstdir
@name = dst
extension = dst.split('.')[-1]
self.process(dst)
self.read_yaml(File.join(base, srcdir), src)
self.data['lang'] = lang
@ -38,7 +39,7 @@ module Jekyll
self.data['category'] = 'alert'
if self.data.has_key?('banner') and !self.data['banner'].nil? and self.data['banner'].length>0
site.config['ALERT']=self.data['banner']
site.config['ALERTURL']='/'+dstdir+'/'+dst.gsub('.html','')
site.config['ALERTURL']='/'+dstdir+'/'+dst.gsub('.html','').gsub('.md','')
if self.data.has_key?('bannerclass') and !self.data['bannerclass'].nil? and self.data['bannerclass'].length>0
site.config['ALERTCLASS'] = self.data['bannerclass']
end
@ -47,8 +48,8 @@ module Jekyll
site.config['STATUS'] = 1
end
if self.data.has_key?('alias')
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['alias']+'.html', date)
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['alias']+'/index.html', date)
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['alias']+'.'+extension, date)
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['alias']+'/index.'+extension, date)
end
end
end