MiddleMan static site generator is based on ruby scripts. It uses the power of ruby scripts to turn simple files and folders into fully responsive websites. It does not have any prerequisites except ruby itself. MiddleMan uses markdown and ruby templates to generate static websites. Today I am going to show you how to install, make use of the MiddleMan, and remove it from your computer in this guide. I have Ubuntu 20.04 LTS installed for this guide. All instructions apply to Ubuntu systems only.
You will need full ruby installation to keep MiddleMan running smoothly on your system.
If you have not yet installed ruby on your system then use the following commands to create a full ruby environment for this guide.
$ sudo apt update
$ sudo apt install ruby-full
MiddleMan requires a minimum of 2.6 versions of ruby’s programming language to begin working. The rest of the things are installed along with MiddleMan.
Step 1. Initiate the Installation
$ gem install middleman
The installation process will begin installing MiddleMan and related ruby gems.
As soon as installed, you will get a success message from the ruby center as shown below and you will be good to go then.
Step 2. Create a MiddleMan Skeleton
Now you are ready, to begin with, your website development process. I will show you how to build a MiddleMan skeleton in the existing directory. Here are the commands:
$ middleman init myNewSite
This command creates a new folder and initializes MiddleMan into it.
Step 3. Build MiddleMan
Now I will change the directory and build the middleman. It is the simplest process throughout the guide.
$ cd myNewSite
$ bundle exec middleman build
Step 4. Preview and Deployment
At this point, you have already produced a successful build of your website. Next, we will make an awesome deployment, but first, we need to make sure that everything is working well.
Use the following build command to run a local server to preview the produced website.
$ bundle exec middleman server
Now the preview website can be seen. It is also ready to be deployed on the server.
You can access the developed website or application on http://ubuntu.local:4567
Step 5. Remove MiddleMan
In any case, if you want to remove MiddleMan from your system simply run the following command. It will be removed for good.
$ gem remove middleman
Throughout the guide, I worked on the installation of ruby, middleman, and related gems that are enough to kickstart your new website. You installed MiddleMan using ruby stack on Ubuntu 20.04 LTS. You have also learned how to run and remove MiddleMan. If you have any questions, you can ask us here without hesitation. We will be delighted to respond.
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.