Linux command
middleman 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create new project
middleman init [project_name]
Start development server
middleman server
Start on specific port
middleman server --port [4567]
Build static site
middleman build
Build with clean output
middleman build --clean
Create new article
middleman article "[Article Title]"
Show version
middleman version
说明
Middleman is a static site generator built with Ruby. It uses templates, layouts, and data files to produce static HTML, CSS, and JavaScript. The development server provides live reloading. Changes to source files automatically refresh the browser. This speeds up the design and development workflow. Templates support ERB, Haml, Slim, and other Ruby templating languages. Asset pipeline handles Sass, CoffeeScript, and JavaScript bundling. Data files in YAML or JSON populate templates dynamically. This separates content from presentation, enabling data-driven pages. The blog extension adds post creation, tagging, and pagination. Articles are written in Markdown with YAML frontmatter. Build produces a static site in the build directory, ready for deployment to any web server or CDN.
参数
- init _NAME_
- Create new project.
- server, s
- Start development server.
- build, b
- Build static site.
- article _TITLE_
- Create new blog article.
- console
- Start interactive console.
- --port _PORT_
- Server port (default 4567).
- --bind _HOST_
- Server bind address.
- --clean
- Remove orphaned files during build.
- --verbose
- Verbose output.
- --environment _ENV_
- Build environment (development, production).
- --help
- Show help.
FAQ
What is the middleman command used for?
Middleman is a static site generator built with Ruby. It uses templates, layouts, and data files to produce static HTML, CSS, and JavaScript. The development server provides live reloading. Changes to source files automatically refresh the browser. This speeds up the design and development workflow. Templates support ERB, Haml, Slim, and other Ruby templating languages. Asset pipeline handles Sass, CoffeeScript, and JavaScript bundling. Data files in YAML or JSON populate templates dynamically. This separates content from presentation, enabling data-driven pages. The blog extension adds post creation, tagging, and pagination. Articles are written in Markdown with YAML frontmatter. Build produces a static site in the build directory, ready for deployment to any web server or CDN.
How do I run a basic middleman example?
Run `middleman init [project_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does init _NAME_ do in middleman?
Create new project.