diff options
-rw-r--r-- | bin/util.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/util.rb b/bin/util.rb index 16c7212..3376699 100644 --- a/bin/util.rb +++ b/bin/util.rb @@ -118,7 +118,17 @@ class Page def slug ; @slug ||= infile.sub(/\..*$/,'').sub(/^.*\//,'') ; end def content ; @content ||= pandoc.to('html5 '+(pandoc['pandoc_flags']||'')) ; end def head ; @head ||= pandoc['html_head_extra'] ; end - def tags ; @tags ||= (pandoc['tags'] || '').split.map{|tag|Tag.new(tag)} ; end + + def tags + if @tags.nil? + raw = pandoc['tags'] || [] + if raw.is_a?(String) + raw = raw.split + end + @tags = raw.map{|tag|Tag.new(tag)} + end + @tags + end def published if @published.nil? |