Documentation For the end user

Quick start#

With carew, you can write simple pages and / or blog posts. Create a new file in pages/ folder to create a new page and in posts/ to create a new blog post.

Each one must begin with a YAML front matter. See Front matter chapter to see all options. Here is a sample page (pages/index.md):

---
title: How to create a new page?
---

So, how to create a new page?

# Step 1

1. step 1.1
1. step 1.2
1. step 1.3

Then run ./carew build and look at index.html in the web/ directory.

Write a blog post#

The file must be located in the posts/ directory and must have a name with the following format: YYYY-mm-dd-slug.md (for e.g. posts/2012-09-20-like-a-hacker.md). Here is a sample blog post:

---
title: Blogging Like a Hacker
layout: post
---

# Blogging Like a Hacker

* I’m bloggin yo!
* ORLY?
* YARLY!

Then run ./carew build and look at 2012/09/20/like-a-hacker.html in the web/ dir.

Write a page#

The file must be located in the pages/ directory (or in one of its subdirectory). Here is a sample page (pages/doc/quick-start.md):

---
title: Quick Start
layout: page
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est, debitis quasi
laborum veniam voluptates praesentium corporis! Soluta, facere, voluptatum
veritatis odio pariatur voluptatem consectetur numquam veniam adipisci
placeat blanditiis magnam!

Then run ./carew build and look at doc/quick-start.html in the web/ dir.

Front Matter#

In order to be converted from markdown to HTML, a file must start with a "front matter" which describes the document's meta-information. Files which don't start with a front matter are simply copied to the web/ directory as is.

Here's a sample of front matter:

---
layout: doc
title: React
desciption: how to use react-php
permalink: react.html
tag: [php, react]
navigation: [main]
author: John Do
---

All others keys (for example description) will be used in a HTML tag.

Directory structure#

Now you can use the following directories:

See configuration documention for more information.

Usage#

Build the site#

In order to build the site, you can use the build command:

$ bin/carew build

This will populate the web directory with a set of files that can be deployed onto any static web server.

You can change input / ouput directory. Run for more information:

$ bin/carew help build

Create a new blog post#

Just run:

$ bin/carew carew:generate:post [--date="..."] "title"

What next?#

Why not read the whole Cookbooks?