middleman blog at /blog with already made static site?

95 views Asked by At

I already have a site up that's using middleman (template=html), but now I want to add a blog to that site, so that when you go to example.com you see the homepage (not blog), and when you go to example.com/blog you see the blog.

This seems like it should be really easy, but it's my first time working with middleman, so apologies. Every article I read is either setting up a non-blog site, or setting up a site with the blog on the front page.

So what's the best way to do the above?

EDIT: to clarify, right now I have it set up with source/index.html.erb as my homepage, and source/blog.html.erb has my blog html. the articles show up in a list, but the "recent articles" and "tags" sections don't show up, so seems like this isn't the way to do it.

1

There are 1 answers

0
Aris FM On

Just setup your middleman as a blog. You can create a static page in middleman blog. I suggest you to create two layout, one for static and other for your blog (read more about middleman layout here)

Then set your blog configuration to use blog layout from config.rb. For your static page, call static layout using YAML frontmatter like this:

---
layout: static
---

Hope this helps :)