1 | # Darko
|
2 |
|
3 | A Node.js port of popular site generator Jekyll.
|
4 |
|
5 | ## Status
|
6 |
|
7 | Works:
|
8 |
|
9 | - darko build
|
10 | - darko serve
|
11 | - darko serve --watch
|
12 |
|
13 | Will be working shortly, stay tuned:
|
14 |
|
15 | - darko new
|
16 |
|
17 | Most of Jekyll special filters are implemented in Darko now. See
|
18 | [this list](http://jekyllrb.com/docs/templates/). But I've left out `textilize`.
|
19 |
|
20 | Tags like `post_url` are not ready yet. Give me a nudge if you need those.
|
21 |
|
22 | ## Try
|
23 |
|
24 | ```bash
|
25 | $ npm install darko -g
|
26 | $ z thx.github.io # cd into a jekyll site.
|
27 | $ darko serve
|
28 | ```
|
29 |
|
30 | Now point your browser to <http://localhost:4100>.
|
31 |
|
32 | If you're working on project repos and there's no CNAME used, there must be a
|
33 | `baseurl` set in your project's _config.yml file. In that case, say your project
|
34 | name is `my-project`, you'll need to point your browser to
|
35 | <http://localhost:4100/my-project>.
|
36 |
|
37 | ## Why?
|
38 |
|
39 | Jekyll is an awesome tool. It is the de facto static site generator for it
|
40 | being the generator of github pages. I've been using it for long. Most of
|
41 | my web sites are developed with Jekyll, such as:
|
42 |
|
43 | - [Everything Jake](http://cyj.me)
|
44 | - [THX](http://thx.github.io)
|
45 | - [Brix Core](http://thx.github.io/brix-core)
|
46 |
|
47 | But when I tried introducing this wonderful tool to my colleagues I was a bit
|
48 | out of luck. Mac users were bothered by Ruby, Python, and Pygments installation.
|
49 | Windows users encountered more issues, mostly encoding related.
|
50 |
|
51 | Hence I create Darko to address those issues. It should:
|
52 |
|
53 | - have less requirements, which makes it easier to install.
|
54 | - works just like Jekyll, which makes the use of it transparent to servers that
|
55 | support Jekyll currently.
|
56 |
|
57 | Windows 下安装、使用 Jekyll 诸多不便,尤其是不了解 Ruby 的同学。早前的版本还要人肉修补
|
58 | [编码问题](http://stormtea123.github.io/convertible.av/),在随 github-pages gem
|
59 | 中指定的 jekyll 版本中已经修复,但目前仍有如下不便:
|
60 |
|
61 | - 需要安装 Ruby
|
62 | - 需要安装 Python
|
63 | - 需要安装 pygments
|
64 |
|
65 | 可以看到,有不少学习成本,为了写点文档竟然要装这么多东西,有点不好接受。
|
66 |
|
67 | 所以有了 Darko ,它有如下目标:
|
68 |
|
69 | - 减少依赖,Node.js 就够了。
|
70 | - 兼容 Jekyll ,对服务端透明,使用 Darko 开发的网站代码,推送到 gh-pages 效果不变。
|
71 |
|
72 | ### About the Name
|
73 |
|
74 | The name of this project, Darko, is a tribute to one of my favorite movies
|
75 | called [Donnie Darko](http://www.imdb.com/title/tt0246578/).
|
76 |
|
77 | Darko 来自电影《[Donnie Darko](http://movie.douban.com/subject/1306662/)》,
|
78 | 我扮文艺青年的时候,喜欢说这是我最喜欢的电影,因为它够小众,剧情初看复杂实际简单,我的
|
79 | 英文名字就取自这部电影的主演 Jake Gyllenhaal。
|
80 |
|
81 | 我本想取名 Jekyll.js ,但是要做到 100% 与 Jekyll 保持一致太难了,而且对追求 100% 的人
|
82 | 来说,他们应该不介意直接用 Jekyll 本身。我搞定 80% 就好。
|
83 |
|
84 | ## Tribute
|
85 |
|
86 | ### nico
|
87 |
|
88 | The markdown and syntax highlighting part of code are shamelessly copied from
|
89 | @lepture's static site generator, [nico](https://github.com/lepture/nico).
|
90 |
|
91 | @lepture's one of my Node.js hero.
|
92 |
|
93 | ### liquid-node
|
94 |
|
95 | Without @sirlantis' [liquid-node](https://github.com/sirlantis/liquid-node),
|
96 | darko won't be possible.
|
97 |
|
98 | ### component, commander.js, and others
|
99 |
|
100 | `util.log`, `util.error`, `util.fatal`, and `util.warn` are all copied from
|
101 | [component](https://github.com/component/component) the package manager by TJ.
|