Writing content
Creating a new page is easy:
- Open a new file in your editor.
- Enter some text (formatted as Markdown, Textile or Haml).
- Save the file in the
content/pages/
directory with a.mdown
,.textile
or.haml
extension.
There's slightly more to it than that, so let's look at some examples.
-
Making web pages
You can create a web page by making a new Markdown, Textile or Haml file in the
content/pages
folder. -
Writing articles
An article or blog post is nothing special; it's just a web page that was published at a given time.
-
Adding attachments
Attachments can be served directly from your site, and are stored in the
attachments
sub directory of yourcontent
directory. -
Working with menus
Menus are optional; not all themes will necessarily use a menu, and you don't have to fill it in if you don't want to. Having said that, if you do, you'll need to know what to do.
-
Metadata reference
A full list of the Nesta metadata, which allows you to organise your site into categories and convert simple web pages into blog posts.
-
Markdown Cheat Sheet
Markdown is a wonderfully simple approach to creating web pages, written by John Gruber of Daring Fireball. You get on with the business of writing (without any fancy code) and Markdown takes care of producing clean, web standards compliant HTML.
Articles on Writing content
-
Make a page that lists old articles
Out of the box, Nesta doesn't provide a page that lists all your old blog posts. It is however, easy to add one.
-
Refresh the browser when you save a file
Most of the pages on a Nesta site are written in a text editor, using Markdown or Textile. You don't get to see what your words look like on a web page you save the file to disk and reload your browser. Wouldn't it be nice if your browser automatically reloaded pages as you saved them? When designing a theme, what if changes to HTML and CSS were reloaded immediately?
-
Using a different Markdown processor
There are a handful of Markdown processing libraries available for Ruby, each with different advantages and features. Since version 0.9.11, Nesta uses Ryan Tomayko's [Tilt][] library to work out which processor to use when rendering a file within your
content
folder, which will try and pick a suitable processor for you. This recipe shows you how to change it. -
Adding author biographies to articles
Imagine for a moment that you run a blog that frequently runs articles from guest bloggers. They provide the content, and in return get some publicity and a link back to their own site from the bottom of their article. What's the best way to do this with Nesta?
-
Change your URLs without losing visitors
It's easy to move pages with Nesta; you just move files around on disk and push your changes up to your web server. But what about all the old links to the page? You need to configure some HTTP redirects...