Skip to content

Instantly share code, notes, and snippets.

@lbain
lbain / Insert .html to file names
Created December 10, 2016 11:44
With the middleman v4 upgrade it is now required that filenames have fully qualified file extensions. For the most part, this means they need .html added after the filename before the rest of the extensions. This gist will help with the renaming process.
path_to_project = "" # FILL ME IN
# Step 1: get a list of all the extensions you use
require 'set'
extensions = Set.new []
Dir.glob(path_to_project).each do |file|
parts = file.split('.')
extensions.merge(parts[1.. parts.length])