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

Frontmatter in Padrino

In Middleman, there is a feature called frontmatter. Basically, you can put some YAML in front of your view and access it in the view and the layout like this: --- my_list: - one - two - three ---

List

    <%…
iblue
  • 29,609
  • 19
  • 89
  • 128
0
votes
1 answer

middleman localizing entire templates not working

I am building a web site using middleman 3 prototype template extension en (English language) as default root language According to this…
Tun
  • 1,345
  • 13
  • 34
0
votes
3 answers

Is it possible to add sub-items to a YML list?

Given the following YML format, is it possible, or advisable to map URLs so that components like nav lists can be both populated and linked? It can be populated: products: - Wizzy Widgets - Doohickeys - Thingamabobbers renders via the…
Kevin Suttle
  • 8,358
  • 3
  • 33
  • 37
0
votes
2 answers

Middleman Build assets without hash

How do I configure Middleman to build images without appending a hash to the filename? I'm referring to filepaths in javascript and need to know the full filename to refer to the files. My JS doesn't get updated with the hashed filenames like my CSS…
mehulkar
  • 4,895
  • 5
  • 35
  • 55
0
votes
1 answer

`rbenv rehash` not generating shims (using rbenv-gemset plugin)

I'm using rbenv and rbenv-gemset to manage the gems for a middleman project. Even though I've run the rbenv rehash command, the shim for middleman does not exist: → middleman git:(master) × rbenv which middleman rbenv: middleman: command not…
asgeo1
  • 9,028
  • 6
  • 63
  • 85
0
votes
1 answer

Custom Tag in Middlemanapp

I am creating a blog in the current version of Middleman and I want to be able to create a list of all the authors on the blog to display on a sidebar (just as I would a tag, that would then link to a page that listed all authors posts (sort of like…
0
votes
3 answers

Change Middleman CSS Directory

I'm having a one problems with my Middleman site. I have two questions I haven't been able to figure out: How do I move the "all.css.scss" file that my "index.html.erb" file is referencing to the "Sass" folder? Of course, the link breaks when I…
0
votes
3 answers

Ruby Limit / Take / First - limit sometimes or ignore

I have the following method: Now sometimes I want the limit attribute to be ignored Therefore the .take method would be ignored, at the moment I do not know how to do this gracefully. As setting to nil errors the code. Any help appreciated - new to…
Ian Warner
  • 1,058
  • 13
  • 32
0
votes
1 answer

Error building a theme with middleman (can't convert nil into String), /usr/local/bin/middleman:23:in `load'

I try to built a theme with ruby (css, js, etc) but I have an error that I've spent hours trying to resolve it and reading docs, but without success. Here is the error I get when I do a : bundle exec middleman build --verbose == Request:…
yann
  • 87
  • 2
  • 10
0
votes
2 answers

Middlemanapp fails build over SASS error

I have a git controlled middleman app across two work machines. Identical copies of ruby and all gems updated. Middleman Server works just fine on both machines and Build works fine on one of the machines - but if I run build on the second dev…
motleydev
  • 3,327
  • 6
  • 36
  • 52
0
votes
1 answer

Middleman 3.0.4 doesn't build

I'm trying to make a build for a client's project and I'm getting too many errors. bundle exec middleman build /Users/mbp-gomes/.rvm/gems/ruby-1.9.3-p448/gems/middleman-sprockets-3.1.2/lib/middleman-sprockets/sass_function_hack.rb:18:in `image_url':…
Rafael Gomes
  • 112
  • 1
  • 9
0
votes
1 answer

NoMethodError when trying to install Middleman on Mac

I am currently trying to install Middleman on Mac OS X. I have already done some initial steps described here: http://petertran.com.au/2013/02/23/how-to-install-middleman-mac-on-macosx/ But the main installation via "gem install middleman" breaks.…
Logemann
  • 2,767
  • 33
  • 53
0
votes
1 answer

Static : Creating a solution for document rating (Redis/Rails/NodeJS ?)

I'm building a static website with 10000+ pages generates from json file with middleman. Each page is a document (pdf) with it's own id, summary and a download link. I need to give anonymous users the ability to rate a document and show global…
Alex
  • 2,036
  • 4
  • 22
  • 31
0
votes
1 answer

Middleman gives 404 in Article Page

I'm getting started building out a blog with Middleman using the middleman-blog extension. Everything is working great so far on the home page. The problem occurs when I click on a link to see the full blog post. The full blog post page has no CSS…
rvazquez
  • 687
  • 1
  • 8
  • 13
0
votes
1 answer

Middleman server not compiling coffeescript

I've used Middleman in the past to work on static projects, and have used CoffeeScript in those projects. In this instance it does not seem to be working. I was under the impression that CoffeeScript compilation should work without any extra…
NolanDC
  • 1,041
  • 2
  • 12
  • 35