Questions tagged [middleman]

Use the popular Ruby Sinatra (Rails-like) Tool chain to build static websites. Build your source files in Markdown, HAML, Textile (or many others), and take advantage of SASS with Compass for styling. Add Javascript, CoffeeScript and Sockets. View the sites locally with the built-in server mode before building static pages. Includes international (i18n) support. Mix in YAML data files and custom Ruby extensions if needed. Unlimited Buzzwords Galore!

Middleman is a static site generator based on Sinatra (a Rails-like Ruby based tool chain). It incorporates dozens of templating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more). It makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle.


Typical Development Cycle

This is the typical development cycle with Middleman:

  • Run middleman init projectname
  • Start the server with middleman server
  • Modify the files in the directory projectname while viewing them in your browser at http://localhost:4567
  • When you're happy with the files, run middleman build
  • Copy the generated static files from projectname/build to your webserver

Having the server available while developing turns out to be critical, as it allows quick review of changes ( For auto-reload, use middleman-livereload gem). This isn't as much of an issue with "normal" static site generators, but when you start adding partials, SCSS, Compass and the other goodies, that Middleman supports, server mode is invaluable.

Resources

553 questions
0
votes
1 answer

Middleman parent, siblings, children methods

When creating pages in middleman, how do I indicate which pages are parents/siblings/children? The documentation gives some indication how you can use parent siblings and children methods to build navigation and breadcrumbs, but it doesn't say how…
Leahcim
  • 40,649
  • 59
  • 195
  • 334
0
votes
2 answers

iterating over yaml data in middleman template

I have a list of projects in a yaml file which i'd like to dynamically loop thru for a template in a middleman app but am unsure how or if I even can/should do it more dynamically. I have: data.projects.each do |f| proxy…
ere
  • 1,739
  • 3
  • 19
  • 41
0
votes
1 answer

Middleman not parsing source file up template chain if missing ERb tags

I'm converting a Jekyll site to Middleman. I have named my files like filename.html.md.liquid.erb for processing with those libraries in that order: ERb, then liquid, then kramdown. What I found is that if I don't have at least one erb tag in the…
jxpx777
  • 3,632
  • 4
  • 27
  • 43
0
votes
1 answer

Howto create dynamic pages with middleman 3.0.9

I'm fiddling with middleman 3.0.9 for some time now, trying to create some dynamic output that I need. Older versions had the "dynamic pages" feature. 3.0.9 does not seem to have something similar. I do not find anything in the docs, nor in the net…
GeorgieF
  • 2,687
  • 5
  • 29
  • 43
0
votes
1 answer

middleman 3.0.11 do not know template=html5-haml

I'm following getting started on main website. And I copy-paste: middleman init my_new_mobile_project --template=html5-haml Unknown project template 'html5-haml' middleman init my_new_mobile_project --template=html5 Works... Middleman 3.0.11.
przemo_li
  • 3,932
  • 4
  • 35
  • 60
0
votes
1 answer

Use Sinatra/Rack (in MiddlemanApp) to serve PHP files as static text/html?

I'm fairly new to Ruby/Sinatra/Rack. Been using MiddlemanApp for a couple months. I have a need for a couple of PHP pages in my middleman static site. And I'd like to be able to preview those pages in the browser while running middleman server. I…
jevets
  • 23
  • 3
0
votes
1 answer

ruby / middleman noob, path issue when starting middleman on branch

I have a middleman server running fine on the trunk part of my repository. when I try to start middleman on a branch, I get the following error: Guard is now watching at…
Olivvv
  • 1,140
  • 1
  • 13
  • 37
0
votes
2 answers

How to use content_for & yield_content in middleman using slim

I've tried prepending content_for with =, == or - without luck :) index.slim - content_for(:senarios) do h1 Some content layout.slim == yield_content(:senarios) Hope somebody got a solution.
lajlev
  • 772
  • 2
  • 7
  • 22
0
votes
1 answer

Requiring a file from a required file in Sprockets

I would like to require a javascript file that itself requires other javascript files: In main.js //= require plugins ... Shared Code In plugins.js //= require vendor/handlebars-1.0.rc.1.js //= require vendor/jquery.animate-colors-min.js //=…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
0
votes
1 answer

How to Support Embedded Ruby in Middleman-generated Static Pages

I have a static site generated using the excellent Middleman. It has been running happily on an Apache server. I now need to add some embedded Ruby to one of the pages (Ruby that must be evaluated at runtime, not during Middleman's build phase). I…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
0
votes
2 answers

Nested methods in Ruby Helper

I'm working on a project in MiddleMan. Trying to pass the results of a method as the parameters of another method. I'm running into all kinds of syntax issues with the commas and parens. Everything looks right to me, am I crazy? Thanks in…
Mims H. Wright
  • 3,049
  • 1
  • 25
  • 30
0
votes
1 answer

Extending Middleman to handle a new filetype (.JADE)

I'd like to add .jade support to Middleman. I don't need to use any of jade's dynamic features, but I'd like to compile my app in middleman rather than with my own messy compile script. What is the simplest way to add a new file type to Middleman?
doubledriscoll
  • 1,179
  • 3
  • 12
  • 21
0
votes
3 answers

Where to store HTML templates for use in Backbone.js

I'm currently developing a static site (no backend or server stuff) with Backbone.js and Middleman. The site doesnt have any dynamic content, just plain html code. But it has some transitions between pages and some Javascript effects. So I want to…
23tux
  • 14,104
  • 15
  • 88
  • 187
0
votes
1 answer

How to create a relative path to video in Middleman / Padrino?

I am using set :relative_links, true for my Middleman project. This works for image_tag and link_to, but how can I create a relative link to a static asset like a video in a /videos directory? Thanks!
Matt Fordham
  • 3,147
  • 10
  • 34
  • 51
0
votes
1 answer

Allow middleman sass to not throw error when images are missing in assets

I am using Middleman (a sinatra app for front-end demo development). It has sass and asset pipeline. Currently I have this sass file, and many rules references background images: a background: image-url("main_layout/blog.png") no-repeat left…
lulalala
  • 17,572
  • 15
  • 110
  • 169
1 2 3
36
37