diff --git a/_plugins/details.rb b/_plugins/details.rb index 8388ea192..3675e7faf 100644 --- a/_plugins/details.rb +++ b/_plugins/details.rb @@ -1,5 +1,8 @@ module Jekyll class DetailsTag < Liquid::Block + + @@ids = Hash.new(0) + def initialize(tag_name, block_options, liquid_options) super @expand = '' @@ -9,7 +12,10 @@ def initialize(tag_name, block_options, liquid_options) @expand = 'expand' end @title = @options.join(" ") + @id = @options.join("-").downcase + @@ids[@id] += 1 + @id += "-#{@@ids[@id]}" if @@ids[@id] > 1 end def render(context)