How to prevent Kramdown from adding IDs to headings

Is there a way to prevent IDs from being added to all markdown headings? I’m using the default markdown library, Kramdown, and here’s the relevant section from my config.rb which doesn’t seem to be working (unless I’m missing something elsewhere):

set :markdown_engine, :kramdown # this can probably be removed, right? set :markdown, :layout_engine => :haml, :auto_ids => false

There is a way, but I am not a Ruby-programmer and my understanding of the structure of Middleman is too limited.

The kramdown options page might help you to build your own custom renderer. But mind you, middleman itself is using a custom renderer for Kramdown. If you do not want to do this, the workaround is to include the options in the markdown text itself, like this:

{::options auto_ids="false"/}

Cheers.

I think maybe your :layout_engine => :haml is out of place.

This works for me:

set :markdown_engine, :kramdown
set :markdown, :fenced_code_blocks => true, :smartypants => true, :auto_ids => false

See more on Markdown in Middleman here.

Great - thanks. {::options auto_ids="false"/} works within the markdown and within a yaml file which good to know.

Thanks. However, the IDs are still being generated. I’ve copied and pasted your code into my config.rb (checked it, retyped it etc) and read the docs assiduously and just can’t work out what I’m doing wrong.

The config.rb bundled with MM is largely unchanged. I’ve just added a few lines at the bottom of the file (see below). Is there a specific place in the config.rb it needs to go? The IDs are being generated for markdown inputted directly into .md.haml files as well as MD being drawn from .yml files. Thanks again!

# Helpers
helpers do
  def my_md(content)
    Tilt['markdown'].new {content}.render
  end
end

set :markdown_engine, :kramdown
set :markdown, :fenced_code_blocks => true, :smartypants => true, :auto_ids => false

# haml rules
set :haml, { :ugly => true, :format => :html5 }

# Prettify URLs
activate :directory_indexes

# Middleman blog
activate :blog

# Syntax highlighting
activate :syntax