

Start a blog with Harp - kennethormandy
http://kennethormandy.com/journal/start-a-blog-with-harp

======
egeozcan
I'm patiently waiting for a solution on this issue before doing anything other
than experiments with it:
[https://github.com/sintaxi/harp/issues/97](https://github.com/sintaxi/harp/issues/97)

It's a great tool otherwise.

~~~
sintaxi
This has been many peoples first reaction when using harp but in all honesty,
once people start embracing the harp way (using the `_data.json` files) for
their metadata this request quickly goes away. We have seen this time and time
again.

~~~
egeozcan
Obviously, not many people working on the same site, but many people working
on their individual sites. You have this amazing platform and just because of
a simple but show-stopping bug like this, I (and probably many others) can't
use it. I'd fork it and change that but I'm not happy maintaining my own fork.
Allowing individual config files for articles is really important for
companies, especially for documentation archives. I occasionally have a few
thousand articles in the same directory, it wouldn't be maintainable to put
all the metadata from those (for some files, it's half a megabyte of metadata
I'm talking about) into a single file. Not to mention all the authors, trying
to navigate through a single file and getting frustrated.

------
prezjordan
Harp is fantastic, but I'm still curious why the creators shy away from the
static site generator aspect of it. It seems they really don't want Harp to be
in that group, but I'm wondering why.

~~~
sintaxi
Great question. Harp is a great static site generator.

First of all, Harp works completely differently from SSGs like Jekyll in that
it doesn't regenerate the entire application every time you change a file.
Instead, harp only generates the static assets as it needs to (in-memory) to
serve any given request and it doesn't spew out any files. This was throwing a
lot of people off when they thought of it as an SSG because they were
expecting harp generate a bunch of files and then serve those assets. So even
though Harp has a `compile` function for exporting your application to static
assets, it behaves and is built much more like static web server than a static
site generator.

Second, Harp unlike Jekyll doesn't have a strict convention of how your
application is structured with a `_posts` directory and a `_layouts`
directory. Instead, URLs with harp map directly to your file structure exactly
as a static web server does. So if you want the url `/articles/hello-world`
you must have a file in your project called `hello-world.md` or `hello-
world.jade` in a directory called `articles`. The mental model of a web server
translates much better to this paradigm.

------
thibaultCha
Crap. I was building my own solution for Node.js static website generation
with
[https://github.com/thibaultCha/Miranda](https://github.com/thibaultCha/Miranda)
because I didn't know about Harp.

Very good tool, congrats.

Well, what doesn't exist yet is a static forum generator, so...

------
krrishd
Nice! Really a coincidence because just yesterday I made a plan to create my
blog with Harp and see how far that would take me, today I googled it and
landed here, only to find that this was also posted today....

------
SkyMarshal
Looks good, is there any kind of javascript compilation/minification
available? Doesn't appear to be with a quick test, but just checking.

------
krrishd
What do you suggest to be able to have the <title> element on a blog post
while using a layout?

~~~
kennethormandy
Hey krrishd, if you’re using a variable as your title, Harp will use the
correct one in the correct context:
[https://gist.github.com/kennethormandy/6834709](https://gist.github.com/kennethormandy/6834709)

~~~
krrishd
Thanks :) Makes much more sense now. Also, is there any way to pass metadata
to a markdown file?

~~~
kennethormandy
You’re welcome! It’s not directly possible, as technically Markdown isn’t a
templating language. It’s explained a little here:
[http://harpjs.com/docs/development/partial#markdown](http://harpjs.com/docs/development/partial#markdown)

Depending on what you are trying to do, you could have your Markdown files
“wrapped” in a partial, and do whatever you need to with the metadata there.

