Pages

Wednesday, 23 October 2024

Frontman,基于ruby的静态博客程序

 A Ruby-based static website generator.

https://rubygems.org/gems/frontman-ssg

Frontman is a static site generator written in Ruby, optimized for speed. It helps you convert your content to static HTML files, so you can focus on your content instead of maintaining servers.

Check out our wiki for detailed documentation.


Frontman is heavily inspired by Middleman, a fantastic static site generator with a large community and feature set. We've used it for a long time, with great success. However, once our project reached a certain size, we realized that Middleman had a few shortcomings when it comes to performance. It was becoming a serious bottleneck for us to iterate fast. After unsuccessfully trying to improve build time, we had to move away from it. Instead of undertaking a huge, lengthy migration to another tool and language, we decided to preserve our current codebase, and create our own, Middleman-inspired static site generator.

That's how Frontman was born 🚀

We created Frontman with a strong focus on speed, but also as a quick and easy replacement for Middleman. Our goal was to be able to switch from the Middleman gem to the Frontman gem in your project, and for the migration to take less than a day.

If you want to dive deeper into why and how we made Frontman faster than other tools, please watch the presentation we gave on scaling the Algolia documentation.

Installing Frontman

First, make sure you're using Ruby version 2.6 or up. Then, install the Frontman gem on your machine:

gem install frontman-ssg

Creating your site

You can use the frontman init command to initialize a new project in the directory you provide:

frontman init my-project

Then, navigate to the newly created directory:

cd my-project

Developing your site

To start a development server with a preview of your website, run the following command:

frontman serve

Building your site

After you are happy with your changes, you can generate the HTML for all your pages by using the following command:

frontman build

Going further

You can read the Frontman documentation to learn about all the features and possibilities.


from https://github.com/algolia/frontman

No comments:

Post a Comment