diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-01-03 18:27:29 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-01-03 18:31:48 -0500 |
commit | dd8b63d1ca1d86d619b1349ecf3e68414dbb9a80 (patch) | |
tree | 3efd53470135fb094555fef67db9280191b40015 | |
parent | c7d1d2a0dc6930944c2be874a3f040b623ed0a57 (diff) |
Make tags work how I documented them as working.
-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? |