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

In middleman, create a dynamic URL in link_to?

I'm new to middleman and ruby so the syntax is very unfamiliar. I have setup a simple list page and a dynamic article page. This all works fine, but how do i generate the dynamic URL in link_to? My list page is at localhost/list/ And my dynamic…
Trj
  • 657
  • 9
  • 21
0
votes
1 answer

Redirecting Folders in Middleman's config.rb

I'm using the static site generator Middleman to build my site. We currently have landing pages that we proxy via config.rb as such: # landing page template directories to redirect landingpage_seo_templates = Dir['source/landingpages/seo/*.erb'] #…
SkyOut
  • 390
  • 1
  • 10
0
votes
1 answer

Passing Middleman FrontMatter variables into Helper Tags

I want to pass some YAML FrontMatter from a page via something like this: <%= image_tag 'current_page.data.image_path' %> I know that doesn't work because it's treating it as a plain old string rather than a variable, but I'm new to Ruby and…
reneruiz
  • 2,436
  • 2
  • 20
  • 18
0
votes
2 answers

Javascript on Middleman not working

My bootstrap javascript does not seem to be working. They stylesheet however is working just fine, both source and build does not load javascript (for example navbar-collapse) config.rb set :css_dir, 'stylesheets' set :js_dir, 'javascripts' set…
dahal
  • 94
  • 9
0
votes
1 answer

Embed ruby within URL : Middleman Blog

I am having some problem with some facebook share link on Middleman blog:- Well I have : <%= link_to current_article, article %> => Article Title I am trying to have:-
dahal
  • 94
  • 9
0
votes
1 answer

Can Middleman in combation with rails solve XSS request failures

Im trying to create a javascript frontend whom should communicate with my rails backend. I figured installing Middleman would solve the annoying errors: XMLHttpRequest cannot load http://localhost:3000/groups.json. No 'Access-Control-Allow-Origin'…
CaptainCarl
  • 3,411
  • 6
  • 38
  • 71
0
votes
1 answer

Spaces in articles sources - Middleman

I have made a site using middleman-blog. My articles are stored like the following: /source/entries/2012-01-01 - Example Article.md But I am really struggling to set the sources. My Config.rb contains this blog.sources =…
Darcys22
  • 1,204
  • 2
  • 11
  • 20
0
votes
0 answers

Middleman and Phonegap issue

I'm having trouble with setting up Middleman for the past few weeks for one of my class projects. My project use HTML 5 and will be developed for Android. The project is on github and I cloned it on Ubuntu, and I tried to enter command "middleman…
luch0043
  • 3
  • 3
0
votes
1 answer

Middleman server will not start, regexp has invalid internal

I have moved hosting providers and reinstalled ruby and middleman. When I run bundle exe middleman server I get: /var/lib/gems/1.8/gems/haml-4.0.4/lib/haml/parser.rb:86: warning: regexp has invalid interval …
Dan Walmsley
  • 2,765
  • 7
  • 26
  • 45
0
votes
2 answers

Rendering a partial with different content blocks on the same page: i need a partial helper that accepts a content block

I really like how Sass mixins let you wrap a block of code with a customizable wrapper: =container($class) .#{$class}.container .container-inner @content +container(header) foo: bar +container(main) baz: quux Resulting…
Andrey Mikhaylov - lolmaus
  • 23,107
  • 6
  • 84
  • 133
0
votes
1 answer

Dropdown Javascript Not Working in Vocino Foundation for Middleman

I'm building a site using Vocino's setup for Foundation w/ Middleman and I ran into a problem getting the dropdown links working. Here is my layout.haml: html.no-js %head %meta{:charset => "utf-8"} %meta{:content => "IE=edge,chrome=1",…
Schybo
  • 1,653
  • 1
  • 13
  • 12
0
votes
2 answers

Uploaded to S3 with HAML files

I am super web development noob, and I HAML instead of regular HTML files. I went through the steps to upload to S3, and everything worked fine with the test index.html file, but when I uploaded my HAML files, nothing worked. I created the files…
NoobException
  • 616
  • 9
  • 20
0
votes
1 answer

Special char bracket in Middlemanapp's haml classname

I am using Middleman App and Handlebars and need %li.name.s{{status}} to be parsed to something like %li.name.s0, %li.name.s1.. based on a model in javascript. This gave me error: %script{:type => "text/html", :id => "item"} {{#items}} …
HP.
  • 19,226
  • 53
  • 154
  • 253
0
votes
1 answer

Move some markdown data from one markdown file to different

how to parsing markdown to cut off or move some chunks of code from *.md to html with my html template? I have markdown file like this: carrot_soup.md Very nice carrot soup ============ I'd like soup like this: ### Ingredients ### *…
0
votes
1 answer

Middleman App Haml syntax error with Handlebars

I am trying to do this and build using Middleman App %script{:type => "text/html", :id => "showItem"} {{#items}} %li %a{href: "#{{id}}"} {{showName}} {{/items}} The problem is this line %a{href: "#{{id}}"} when {{id}} is inside another…
HP.
  • 19,226
  • 53
  • 154
  • 253