Metadata reference

As you’ve probably noticed, Nesta doesn’t use a database. There is therefore no obvious place to store information about a web page, such as the date that it was published.

Nesta solves this problem by allowing you to specify metadata at the top of your Markdown file. You just write the name of the metadata field, a colon, a space, and then the value of the metadata.

Here’s a contrived example:

Summary: This is a blog post about carrots. Juicy orange carrots!
Read more: Find out about this superb vegetable
Date: 6 Oct 2009

There’s not much to go wrong here, but bear in mind that:

  1. Each piece of metadata should be entered on a single line, and
  2. there can be no blank lines between metadata fields.

The first blank line is assumed to separate the metadata from the content. You’ll typically follow your metadata with the page’s main heading:

Date: 6 Oct 2009

# Carrots

...

Without further ado, here’s a full list of the Nesta metadata.

Atom ID

An alternative to RSS, Atom feeds can alert your readers to new articles that you publish on your site. Each item in an Atom feed must be assigned a globally unique identifier, which allows feed reader software to determine whether or not an article has already been read by the user.

Nesta determines Atom IDs for new articles automatically (using these guidelines), so you don’t normally need to choose the Atom ID yourself. It is useful to set the Atom ID if you are importing content from another CMS or blogging system to the IDs that were generated by your previous software, which ensures that feed readers do not redisplay any old content to your users.

Example:

Atom ID: tag:localhost,2009-03-08:/articles/my-article

Description meta tag

If you define Description your HTML page will have a description meta tag. The contents of this tag are often displayed by search engines to give a potential visitor a good feel for the contents of the page, and help to indicate the relevancy of your web page to a search engine. Try to set your description text to one or two short, relevant sentences.

Example:

Description: A short summary of the British breakfast.

# British breakfasts

...

Categories

Articles appear on relevant category pages. Assuming you want your article to appear on your Git and Ruby category pages (whose filenames are git.mdown and ruby.mdown), you could do this:

Categories: git, ruby

Date

Sets the date on which an article was published. You can use any form that is understood by Ruby’s DateTime.parse method. It’s pretty liberable in what it accepts – all of these examples work:

Date: 23 July 2008
Date: July 23 2008
Date: 14:13, 23 July 2008
Date: 23 July 2008 14:13
Date: 23 July 2008 2:13pm

You must set the date on an article if you want it to appear in the Atom feed (the most recent 10 articles are included, in reverse chronological order). Note that Nesta only displays the date on which an article was published, not the time. You can still use the time to control the sort order of multiple articles that are published on the same day, however.

Keywords meta tag

The Keywords metadata sets the HTML keywords meta tag for your page. Keywords were historically used to indicate to search engines which topics a page is about. Google doesn’t pay much attention to the keywords meta tag these days, but some other search engines still do.

Example:

Keywords: breakfast, cholesterol, heart bypass

# British breakfasts

...

Read more

When the summary of an article (see below) is displayed on the home page, or on a category page, there is a link underneath the summary that points to the rest of the post. By default this link contains the text “Continue reading”, but you can override it if you prefer.

Example:

Read more: Read more about this stunning topic

Summary

The summary text allows you to include a brief precis of your article on your home page or category page. If you don’t define a summary the entire article will be displayed instead, which for short articles may be just what you want.

As blank lines are not allowed within metadata fields you cannot insert multiple paragraphs into your summary by inserting blank lines. You can however insert the “new line” character (\n) which will insert paragraph breaks into your summary field.

Example:

Summary: First paragraph.\nSecond paragraph.

# Main heading

First paragraph.

Second paragraph, which is different to the summary's version.

Summaries aren’t automatically prepended to the body copy, so can be quite independent from the opening paragraphs of your article.

The summary is not used in the site’s Atom feed; the complete article is included in the feed instead.