Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way (or package) to build a static site using Node.js? [closed]

In Short

What's the best way to set up a static blog with Markdown and RSS support, just like this guy did, but use Node and a JavaScript web-framework instead of Python & Django?


In Length

I'd like to build a static site using Node.js, preferably using the help of a ready-made package, similiar to Ruby's Jekyll or Python's Hyde. I'll need some server-side templating (e.g. jade, HAML, Jinja), and maybe some Markdown support, though not necessary.

I've already found out about Express, Petrify, and Node-blog, but I'm not sure they're the right choice.

Any recommendations on the recommended way of action?

like image 776
Ory Band Avatar asked Sep 07 '11 01:09

Ory Band


People also ask

Can I build a whole website using node js?

Yes, you create the whole web server in node. js and use it to serve all your web pages. Typically one might use a number of libraries with node. js such as Express for mapping all the routes in your web app and your favorite template engine to help with filling in data in HTML pages before serving them to the client.

Which module is used to serve static resources Nodejs?

In your node application, you can use node-static module to serve static resources. The node-static module is an HTTP static-file server module with built-in caching.


4 Answers

I highly recommend wintersmith. It is built on node and written in coffeescript.

From wintersmith's features page:

  • Easy to use
  • Generated sites can be hosted anywhere (output is plain html)
  • Write articles/pages using markdown
  • Robust templating using Jade
  • Preview server (no need to rebuild every time you make a change)
  • Highly configurable
  • Extendable using plugins
  • FAST!

To see it in action, check out these examples.

You can also get a working wintersmith site going with:

$ npm install wintersmith -g
$ wintersmith new <path>
$ cd <path>
$ wintersmith preview

I have tried DocPad, wheat, scotch, and blacksmith and have found wintersmith much simpler than DocPad (a true static site generator) and better out of the box, better maintained, and better supported by plugins than the rest.

I am in the process of rebuilding two of my sites to use it.

like image 51
mnewt Avatar answered Oct 19 '22 21:10

mnewt


I just released Kerouac.

I wanted the most ridiculously easy (yet flexible, if needed) way to generate static sites for my projects. No existing solution quite fit the bill, so Kerouac was created. It's heavily inspired by the concept of middleware in Express, so if you're also developing dynamic web apps in Node, Kerouac will feel instantly familiar. The middleware approach proved remarkably effective even for static sites, yielding a simple high-level API with an infinitely flexible low-level API for the inevitable tweaks and customizations.

like image 30
Jared Hanson Avatar answered Oct 19 '22 20:10

Jared Hanson


Give DocPad a whirl: http://docpad.org

DocPad is a CMS with a document-management based approach. It's actively maintained and supported by a growing community. It's modular, easy to extend and able to be used inside bigger systems. It already supports lots of markups and pre-processors through plugins and powers many websites.

like image 34
generalhenry Avatar answered Oct 19 '22 21:10

generalhenry


Checkout wheat http://search.npmjs.org/#/wheat

Also bookmark that site, it's great to find node.js packages.

like image 35
goatslacker Avatar answered Oct 19 '22 19:10

goatslacker