当前位置: 首页 > 软件库 > Web应用开发 > >

noflo-jekyll

授权协议 Readme
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 公孙盛
操作系统 未知
开源组织
适用人群 未知
 软件概览

noflo-jekyll

Flow-based reimplementation of the Jekyll static site generator. This provides several advantages for Node.js and especially NoFlo developers:

  • Pure JavaScript, no need for Ruby or other runtimes in your environment. Especially handy if you're using Grunt for site generation
  • Other data sources, in NoFlo everything is just a flow of data. You could easily plug in other data sources than the file system. For example, database query results
  • Different converters, don't want to use Markdown? Just plug in your own mark-up processor component
  • Different template engines, don't want to use Liquid? Just plug in your own template processor component
  • Use as library or executable, this Jekyll implementation is just a NoFlo graph. You can use it in other NoFlo applications, as a Node.js module, or as a command-line executable

However, as with any reimplementation of a application being actively developed, there are also some potential caveats to observe.

Structure

NoFlo Jekyll has been implemented as a NoFlo graph. Most of the logic is handled by various existing NoFlo components, but there are also some places where implementing things as a custom component made sense. Over 85% of the codebase is completely reusable, however.

Here is how the main flow looks like when visualized using NoFlo UI:

You can find the main flow and the different subgraphs from the graphs folder.

Installation

If you want to use this as a command-line executable, then the easiest option is to install it globally with:

$ npm install -g noflo-jekyll

If you want to use it as a library inside a bigger application, then just install it as a dependency by:

$ npm install noflo-jekyll --save

Command-line usage

Since this project aims for feature parity with Jekyll, the command-line usage is similar. To generate a site, run:

$ noflo-jekyll source_dir target_dir

Usage in Node.js applications

The site generation graph can also be used as a library in Node.js applications.

var Jekyll, generator;
Jekyll = require('noflo-jekyll').Jekyll;

// Prepare the site generator
generator = new Jekyll('source_dir', 'target_dir');

// Event handling
generator.on('start', function () {
  console.log("Build started");
});

generator.on('error', console.error);

generator.on('end', function (end) {
  var seconds = end.uptime / 1000;
  console.log("Build finished in " + seconds);
});

// Start the process
generator.run();

Usage in NoFlo graphs

The main site generation flow is exposed as the jekyll/Jekyll graph. Here is a simple example of using it in another graph:

# Directory setup
'/some/source/directory' -> SOURCE Generator(jekyll/Jekyll)
'/some/target/directory' -> DESTINATION Generator()

# Outputs
Generator() GENERATED -> IN Drop(Drop)
Generator() ERRORS -> IN Display(Output)

Known issues and differences with Ruby Jekyll

Template incompatibilities

The Liquid Templating library we use, liquid-node does not cover 100% of the Liquid spec, so some template parameters that work with Jekyll might not yet work.

We're working with the liquid-node developers to improve the coverage, and this is something you can also help with. Please report an issue if you are using something that doesn't work!

Newer Jekyll features

When this project was started, Jekyll was still in the pre-1.0 stage, and its development had stopped. Since then, its development resumed, and 1.0 added features that we don't yet provide. These include:

  • Draft posts
  • Timezones
  • Baseurl

Please report any issues you encounter with these or other Jekyll features.

No web server

The Ruby Jekyll includes a rudimentary web server for testing purposes. As that is outside of the scope of static site generation, this feature was not included into the NoFlo Jekyll implementation. You can serve the generated pages in many ways, including grunt-contrib-connect, simple-server, or NoFlo webserver.

Testing and development

Pull requests are welcome for any missing Jekyll features or other issues! If you want to work with the repository, it is best to be able to test it locally.

Our main body of tests consists of a Jekyll website source in test/fixtures/source that we have generated to a static site with the Ruby Jekyll. We run NoFlo Jekyll against the same sources, and check that the results are identical (save for some whitespace differences).

If you find things NoFlo Jekyll doesn't handle correctly, add them to that Jekyll site source, and then run Ruby Jekyll fixture regeneration with:

$ grunt jekyll

After this you should be able to run the tests with:

$ grunt test
 相关资料
  • NoFlo 是一个 Flow-Based Programming (FBP) 的 JavaScript 实现,是一种用来独立控制流和软件逻辑的模式,可帮助你组织大规模的应用程序,特别是处理大数据集。 FBP 本身并不是一个新的概念,它来自 IBM 70年代关于可管理商业流程的定义,而 NoFlo 基于 Node.js 上重新定义了这个概念。

  • 问题内容: 我尝试使用Jekyll新命令,但是它不起作用,并在出现错误后出现。 我正在使用Mac OS X 10.8.5 Mountain Lion。 但这对我的情况不起作用。我卸载并重新安装了json,但没有任何反应。如果您知道其他解决方案,请告诉我。自本周初以来,我一直在解决这个问题。 我的宝石清单和宝石环境如下。 请给我建议以帮助我。谢谢! 3月7日更新。 以防万一您想查看自制软件列表, 2

  • 本文向大家介绍jekyll GitHub页面,包括了jekyll GitHub页面的使用技巧和注意事项,需要的朋友参考一下 示例 GitHub为用户或组织和项目站点提供无限托管。Jekyll和静态文件均可用。 以下是在Github上托管Jekyll博客的步骤。 设定 用户或组织站点 创建一个名为username.github.io的存储库,其中username是您在GitHub上的用户名(或组织名

  • Jekyll 是最早开始流行的静态网站构建工具,使用Ruby语言开发,开源已有9个年头了,是Github Pages默认的静态网站构建工具。当前互联网上有大量基于jekyll构建的静态网站,包括现在流行的开源容器编排调度引擎kubernetes的官网。 Jekyll的理念 Jekyll网站构建的理念就是只做用户告诉它要做的事情,不多也不少: No Magic:简单易懂 It “Just Works

  • 本文向大家介绍如何在Ubuntu 16.04上设置和配置Jekyll开发站点,包括了如何在Ubuntu 16.04上设置和配置Jekyll开发站点的使用技巧和注意事项,需要的朋友参考一下 在本文中,我们将学习如何设置和配置Jekyll开发站点。Jekyll在数据库驱动的站点中提供了内容管理系统(CMS)的优势,并具有性能和安全性。它也称为博客意识,具有处理按日期组织的内容的功能。它特别适合于离线工

  • 在Jekyll的帖子中,我想在地址中包含我的图像。 此外,我希望它具有750px的宽度。 我试过了 我应该使用什么语法?