Let's add support for WordPress style teasers: teaser and the rest of the content
separated by a
<!-- more --> comment.
Well, first you add the comment to your posts, like this:
index.jade, you can render the post and strip away the comment and
everything after it. Then you got your teaser. This is possible because partials
in the Harp flavored Jade is implemented by passing in a
partial(postFilePath) actually returns the rendered post as a
String.prototype.replace() to strip
away everything you don't need.
Prefix each line with
- to make it unbuffered code in Jade.
The teaser will look like this:
Put it in the front page.
Making Tag Pages
My solution is to populate the tag page with all tags, and hide those tags you don't want. The wanted tag name is passed in via the hash part in the URL.
Tags, as I mentioned in the Migrated Blog to Harp post,
should be specified in the
_data.json file. Extracting tags from the file is
Source of my tag template:
Jade Snippet to Find Page Data
Harp only sends in a
current object with path info of the template. To find
don't forget to prefix the lines):
I put it in
_page.jade and include it in almost every Jade template.