From dd8b63d1ca1d86d619b1349ecf3e68414dbb9a80 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 3 Jan 2017 18:27:29 -0500 Subject: Make tags work how I documented them as working. --- bin/util.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'bin') 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? -- cgit v1.2.3-54-g00ecf