Ruby實現的網站生成器,Ruby webgen 1.2.0 發布

jopen 10年前發布 | 6K 次閱讀 Ruby webgen

webgen 是用Ruby實現的網站生成器。它是用來產生從模板和頁面文件的靜態網站。具有快速,易于使用,可擴展的特點。

以下是它的功能特性:

  • Core Features

    The following list shows general benefits of using webgen:

    • Fast (only the necessary files are regenerated)
    • Easy to install and use
    • Supports translating any files (content files or assets)
    • Runs on Linux, Mac OS X, Windows
    • Extendable by writing add-ons in Ruby
    • Easy to configure if one needs to (no need if you are happy with the default values)
    • Command line interface uses command style syntax (like git command)
  • Supported Formats/Markup Languages

    webgen content files can be written in a number of different formats and new formats can easily be added. Here is a partial list:

    • Markdown (including special syntax like setting header ids and html attributes through thekramdown library)
    • Textile (through the RedCloth library)
    • Haml and Sass
    • RDoc (the native API documentation format for Ruby)
    • Builder (tool for programatically creating XML documents)
    • Smiley-to-emoticon conversion (through an official extension bundle)
  • Supported File Types

    Anything can be put into webgen’s source directory so that it gets copied to the destination directory but some file types are handled specially, for example:

    • Page files (primarily used to define the content of a web page but can really be used to create about any text-based file format)
    • Template files (used to define the general layout of a web page, these are chainable/nestable)
  • Dynamic Content

    Although webgen is used to create a static website, it allows one to embed dynamic parts to support features like dynamic menu generation, dynamic link generation and more. Here are some of the available methods for adding dynamic content:

    • webgen tags: these allow non-programmers to easily add dynamic content using a simple markup syntax. webgen ships with many tag extensions for
      • generating menus and breadcrumb trails
      • listing all translations of a page
      • syntax highlighting code fragments or entire files
      • and much more
    • ERB (embedded Ruby) for custom scripts embedded into content files for advanced users.
  • Other Features

    Additionally to the above webgen provides some other useful features:

    • Specify meta information (e.g. title, ordering information, …) for any file through specialmeta info files
    • Support for specifying virtual files and directories (can be used, for example, to include links to external pages in menus)
    • Generated HTML files can be automatically checked if they are standard conform
    • Automatic rebuilding of the website when a source path changes
    • Automatic generation of needed directory index files


版本說明:此版本增加了兩個新的標記選項,并修復兩個錯誤。更新建議。

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!