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

Browser ignores javascript added by middleman content_for

I'm developing clientside application and i use middleman for this And on my index page i have optional scripts that i add to the rest of the scripts at the bottom of body tag into final layout via content_for helper. (i call yield_content :js if…
idrozd
  • 145
  • 2
  • 10
0
votes
3 answers

In middleman, how do set variables?

I've started experimenting with middleman and ruby. The sample layout has this string:
user1419762
  • 3,571
  • 5
  • 20
  • 10
0
votes
1 answer

How to use a custom Project Template in Middleman on Windows

I have created a custom project template for Middleman. The documentation states that I should store templates in the ~/.middleman/ folder. This works fine on Mac, but where should I store the template on Windows 7? I have tried putting it in a…
Keegan Street
  • 155
  • 1
  • 6
0
votes
1 answer

How do I use firesass from middleman

How do I enable sass's '--debug-info' switch from middleman? I've been using sass for creating css, and firesass for debugging the sass. I've just started playing with middleman, which makes use of sass. The problem is, I can't figure out how to…
bob
  • 753
  • 4
  • 15
  • 27
0
votes
1 answer

sprockets dont want to compile valid coffee script

@element.stop().animate scrollLeft: @left scrollTop: @top , @options.duration, "linear" it compiles in online interpreter (coffeescript.org) to: this.element.animate({ scrollLeft: this.left, scrollTop: this.top }, this.options.duration,…
puchu
  • 3,294
  • 6
  • 38
  • 62
-1
votes
1 answer

How to call `<%= partial '...' %>`

I'm doing statics on html5. I have many HTML lines of the same type: The site has many pages, and editing these lines takes a lot of time for each…
Vision 10
  • 13
  • 5
-1
votes
2 answers

HAML / Ruby Loop variable being appended with Content_For

I have a YAML file of products: # Product - Granola Bar - title : "Granola Bar" excerpt : "Comes in several amazing varieties including nut, and delicious fruit." description : "Comes in several amazing varieties including nut,…
Ian Warner
  • 1,058
  • 13
  • 32
-1
votes
1 answer

Middleman helpers not working in markdown file

I'm using middleman and redcarpet for markdown rendering In my markdown file, I used helpers. If I save that file with .md extension, helpers did not work. If I save that file with .md.erb extension, it works fine. But I want to save file with .md…
vasek
  • 11
  • 5
-1
votes
1 answer

Local variable is nil, when it clearly shouldn't be (assigned to an expression with itself)

Why does this little code snippet (for a navigational helper with css classes) give me an undefined method 'include?' for nil:NilClass on the elseif-line? The page_classes_string may be something like 'oddchap oddchap_zoidberg…
cseelus
  • 1,447
  • 1
  • 20
  • 31
-2
votes
1 answer

Haml if statement issue

I'm having an HAML issue writing an if else statement ... I have this code : - experiences.each_index do |index| - if index % 2 == 0 ? .group .left - else .right %p= experiences[index].company And I would like to produce that…
Vincent Prigent
  • 119
  • 1
  • 6
-2
votes
5 answers

Merge string and variable as argument?

I want to pass the string 'header__button' and the response from method classify(f) as the argument class to link_to. I tried <%= link_to f, '/dashboard', class: 'header__button' classify(f) %> but Ruby won't allow it. How can it be done?
Himmators
  • 14,278
  • 36
  • 132
  • 223
-2
votes
2 answers

What does this error while running 'middleman' mean?

I came across this middleman package and tried to run it with bundle exec middleman server but get this back in the terminal... The source :rubygems is deprecated because HTTP requests are insecure. Please change your source to…
Antonio Pavicevac-Ortiz
  • 7,239
  • 17
  • 68
  • 141
-3
votes
1 answer

What's the best way to implement dynamic text on a static page?

I want my blog to be more interesting by making it different every time a reader reads a post. For example, I want to tell a story using a quote from a famous person, a picture, and a situation from the real life. Say, I have 2 relevant quotes, 3…
1 2 3
36
37