Trying to add a blog to an existing non-blog project

I slowly pieced together a semi-working blog by adding the blogging gem to the gemfile and activating it in config.rb:

  blog.prefix = 'listening'
  blog.layout = 'layouts/blog'
  blog.default_extension = '.md'

i also copied the calendar.html.erb, feed.xml.builder, index.html.erb, and tag.html.erb files into the /listening, along with a sample .md file.

I am able to successfully render the post on the /listening blog index but once I click on the archive link it gives an error: undefined method `link’ for nil:NilClass

What am I doing wrong? Thanks in advance

Debug: Look at the console output and see what line the error is. Then figure out what the NilClass is supposed to be.

Thanks – I’m a bit of a Rubynoob so I’ll definitely look into this!

can I do “middleman init MY_BLOG_PROJECT --template=blog” on existing project?

or what’s the recommended way?

If you already have a Middleman project, you can re-run middleman init with the blog template option to generate the sample index.html, tag.html, calendar.html, and feed.xml, or you can write those yourself. You can see what gets generated on GitHub.

found it, but it replaces some of the files, so be careful. I guess better make files by your own