Questions tagged [middleman-4]

Version 4.0 of middleman.

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

33 questions
1
vote
1 answer

Middleman sitemap.where doesn't exist

I'm trying to automatically generate a list of links to pages that have certain frontmatter in them, but every time I try to use sitemap.where(), I get a NoMethodError. For example, the following line: <%= sitemap.where(:title=>"about")…
Zak
  • 2,688
  • 4
  • 29
  • 45
1
vote
0 answers

How to make a link redirect to external URL in middleman

How to make example.com/go/link/ redirect to example1.com/go/link/ in middleman. How do I maintain a list of redirects like that?
Sathish Manohar
  • 5,859
  • 10
  • 37
  • 47
1
vote
2 answers

Sass - undefined error $helvetica

Working with middleman and using Bourbon, Neat and Bitters. Once I start the server, I get following error message - Error compiling CSS asset Sass::SyntaxError: Undefined variable: "$helvetica" in (source/stylesheets/base.css.scss:…
Aniruddha
  • 3,157
  • 4
  • 32
  • 48
0
votes
0 answers

What is the recommended way of visual testing with Middleman and GitLab CI?

What is the recommended way of visual testing with Middleman and GitLab CI? What is the best way to ensure that code changes are not breaking the views.
alexanderadam
  • 415
  • 6
  • 17
0
votes
0 answers

After upgrading middleman from 3.4.1 -> 4.4.3, ".js.coffee" files are not loading

added activate :sprockets in config.rb, configure :development section. Few .js and .js.coffee files are not loading, although the paths of files are same which was there with middleman 3.4.1. Ruby version: 2.6.10 Middleman version: 4.4.3 Middleman…
Suparna
  • 85
  • 2
  • 14
0
votes
0 answers

How to fix - undefined method `register' for Middleman::PhpExtension:Class (NoMethodError)?

I'm trying to update middleman version(3.4.1 -> 4.4.3) in my project. I'm using bundle version(2.3.26), and ruby(2.7.7). After upgrading when trying to run - bundle exec middleman, I'm getting the below error. My project is in macos system. bundler:…
Suparna
  • 85
  • 2
  • 14
0
votes
1 answer

New paragraph in yml file with middleman

I'm using middleman for a static website with data in different YAML files. I would like to split some of this data on multiple lines. I've browsed the documentation and different forums but did not find anything that worked for me. Below is the…
Antoine Quellier
  • 152
  • 2
  • 11
0
votes
1 answer

Custom helper with block

I'm using the current release 4.3.3 of Middleman. I'd like to define a custom helper which accepts a block. For the sake of simplicity, here's a nonsensical example of wrap_me which wraps the block content with the given tag. It should be possible…
svoop
  • 3,318
  • 1
  • 23
  • 41
0
votes
1 answer

Avoid building identical pages with Middleman proxy

I am creating a static website with Middleman, referencing products parsed from a spreadsheet. My table has these columns: _________________________________ | Product Name | Price | Category | | Pet Food | $12 | Pets | | iPhone | …
Marwann
  • 163
  • 3
  • 14
0
votes
1 answer

Middleman test and console environments for config.rb

I'm using Middleman v4 and I'm having issues in both the console and when I use RSpec to unit test my libraries. Right now I comment out most of my config.rb file, something like this. require 'lib/foo' require 'lib/bar' #activate external_pipeline…
rb-
  • 2,315
  • 29
  • 41
0
votes
1 answer

Middleman with vue-router loading 'Page Not Found' on page reload

I'm building a website that uses Middleman (Ruby) on the backend and VueJS on the front end, along with vue-router to handle routing. In my vue-router index, I'm loading the Video component on /chapter/:id as you can see here: const routes = [ { …
Terence Devine
  • 115
  • 1
  • 13
0
votes
1 answer

I installed middleman, but I still have v3.4.1 and not v4 as expected

I don't know if I am thinking right, but I couldn't find anything on the web regarding the installation of middleman v4. I did the installation as explained on Middleman website : https://middlemanapp.com/basics/install/ And my Gemfile in my…
arnaudambro
  • 2,403
  • 3
  • 25
  • 51
0
votes
1 answer

How to add AMP to a static website, generated using middleman

I am a beginner to AMP(Accelerated Mobile Pages). I have my website built with middleman as it is already built, it contains several pages on it. I knew it is going to take much time to completely validate my whole site into AMP. I am more…
rajesh
  • 7
  • 6
0
votes
0 answers

Duplicate Contentful yaml files with Middleman 4 and contentful_middleman

When running bundle exec middleman contentful, two yaml files are being generated, somehow causing both to be deleted from data/test_space/post. However, a .tmp directory with backups is being created containing the contentful yaml data. I've…
lukebm
  • 163
  • 11
0
votes
1 answer

Middleman - Unique Categories with amount of posts in each sorted

I want to get the Unique categories from my blog posts - but also return the count of how many posts are in each category Currently I have this = blog( 'portfolio' ).articles.map { | r | r.data.category }.uniq.sort I guess I need to remove the Uniq…
Ian Warner
  • 1,058
  • 13
  • 32