Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Updated index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hassankhan committed Feb 15, 2014
1 parent 0d62620 commit 3424aa1
Showing 1 changed file with 54 additions and 88 deletions.
142 changes: 54 additions & 88 deletions content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,100 +9,66 @@ Congratulations, you have successfully installed [Zepto](http://Zepto.dev7studio

### Creating Content

Zepto is a flat file CMS, this means there is no administration backend and database to deal with. You simply create `.md` files in the "content"
folder and that becomes a page. For example, this file is called `index.md` and is shown as the main landing page.

If you create a folder within the content folder (e.g. `content/sub`) and put an `index.md` inside it, you can access that folder at the URL
`http://yousite.com/sub`. If you want another page within the sub folder, simply create a text file with the corresponding name (e.g. `content/sub/page.md`)
and you will be able to access it from the URL `http://yousite.com/sub/page`. Below we've shown some examples of content locations and their corresponing URL's:

<table>
<thead>
<tr><th>Physical Location</th><th>URL</th></tr>
</thead>
<tbody>
<tr><td>content/index.md</td><td>/</td></tr>
<tr><td>content/sub.md</td><td>/sub</td></tr>
<tr><td>content/sub/index.md</td><td>/sub (same as above)</td></tr>
<tr><td>content/sub/page.md</td><td>/sub/page</td></tr>
<tr><td>content/a/very/long/url.md</td><td>/a/very/long/url</td></tr>
</tbody>
</table>

If a file cannot be found, the file `content/404.md` will be shown.

### Text File Markup

Text files are marked up using [Markdown](http://daringfireball.net/projects/markdown/syntax). They can also contain regular HTML.

At the top of text files you can place a block comment and specify certain attributes of the page. For example:

/ *
Title: Welcome
Description: This description will go in the meta description tag
Author: Joe Bloggs
Date: 2013/01/01
Robots: noindex,nofollow
*/

These values will be contained in the `{{ meta }}` variable in themes (see below).

There are also certain variables that you can use in your text files:

* <code>&#37;base_url&#37;</code> - The URL to your Zepto site

### Themes

You can create themes for your Zepto installation in the "themes" folder. Check out the default theme for an example of a theme. Zepto uses
[Twig](http://twig.sensiolabs.org/documentation) for it's templating engine. You can select your theme by setting the `$config['theme']` variable
in config.php to your theme folder.

All themes must include an `index.html` file to define the HTML structure of the theme. Below are the Twig variables that are available to use in your theme:

* `{{ config }}` - Conatins the values you set in config.php (e.g. `{{ config.theme }}` = "default")
* `{{ base_dir }}` - The path to your Zepto root directory
* `{{ base_url }}` - The URL to your Zepto site
* `{{ theme_dir }}` - The path to the Zepto active theme direcotry
* `{{ theme_url }}` - The URL to the Zepto active theme direcotry
* `{{ site_title }}` - Shortcut to the site title (defined in config.php)
* `{{ meta }}` - Contains the meta values from the current page
* `{{ meta.title }}`
* `{{ meta.description }}`
* `{{ meta.author }}`
* `{{ meta.date }}`
* `{{ meta.date_formatted }}`
* `{{ meta.robots }}`
* `{{ content }}` - The content of the current page (after it has been processed through Markdown)
* `{{ pages }}` - A collection of all the content in your site
* `{{ page.title }}`
* `{{ page.url }}`
* `{{ page.author }}`
* `{{ page.date }}`
* `{{ page.date_formatted }}`
* `{{ page.content }}`
* `{{ page.excerpt }}`
* `{{ prev_page }}` - A page object of the previous page (relative to current_page)
* `{{ current_page }}` - A page object of the current_page
* `{{ next_page }}` - A page object of the next page (relative to current_page)
* `{{ is_front_page }}` - A boolean flag for the front page

Pages can be used like:

<pre>&lt;ul class=&quot;nav&quot;&gt;
{% for page in pages %}
&lt;li&gt;&lt;a href=&quot;{{ page.url }}&quot;&gt;{{ page.title }}&lt;/a&gt;&lt;/li&gt;
{% endfor %}
&lt;/ul&gt;</pre>
Zepto is a flat-file CMS, so there's very little backend and no database to deal with. You simply create ``.md`` or ``.markdown`` files in the ``content`` folder and that becomes a page.
If you created folder within the content folder (e.g. ``content/sub``) and put an ``index.md`` inside it, you can access that folder at the URL ``http://yoursite.com/sub``. If you want another page within the sub-folder, simply create a text file with the corresponding name (e.g. ``content/sub/page.md``) and will be able to access it from the URL ``http://yoursite.com/sub/page``.
Below are some examples of content locations and their corresponding URLs:

|Physical Location |URL |
|--------------------------|----------------|
|content/index.md |/ |
|content/sub/index.md |/sub |
|content/sub/page.md |sub/page |
|content/a/very/long/url.md|/a/very/long/url|

If a file cannot be found, a HTTP status 404 is sent and the 'Page Not Found' page is displayed.

#### Text File Markup

Text files are marked up using Markdown. They can also contain regular HTML. At the top of text files you can place a block comment and specify certain attributes of the page. For example:

/*
Title: Welcome
Description: This description will go in the meta description tag
Author: Joe Bloggs
Date: 2013/01/01
Robots: noindex,nofollow
Template: index (allows you to use different templates in your theme)
*/
These values will be contained in the ``{{ meta }}`` variable in themes (see below).

### Templating

Zepto uses Twig for templating, and therefore assumes you already know how to use it. There's already a ``base.twig`` in the ``templates`` folder, but you can always put your own Twig templates in there.

You'll have the following variables available to you in every template:

{{ config }} - Contains the values you set in config.php (e.g. {{ config.theme }} = "default")
{{ base_dir }} - The path to your Zepto root directory
{{ base_url }} - The URL to your Zepto site
{{ site_title }} - Shortcut to the site title (defined in config.php)
{{ meta }} - Contains the meta values from the current page
{{ meta.title }}
{{ meta.description }}
{{ meta.author }} // Should contain at least these three, the next three are optional
{{ meta.date }}
{{ meta.date_formatted }}
{{ meta.robots }}
{{ content }} - The content of the current page (after it has been processed through Markdown)
{{ nav }} - Returns a HTML-formatted representation of the content folder, if you're using the ``NavGenPlugin``

You will also have access to the following helper functions:

{{ url_for('name-of-file.md') }} - Returns the fully-qualified URL for the file
{{ link_for('name-of-file.md') }} - Returns an &lt;a&gt; tag for the file

### Plugins

See [http://Zepto.dev7studios.com/plugins](http://Zepto.dev7studios.com/plugins)
**coming soon**

### Config

You can override the default Zepto settings (and add your own custom settings) by editing config.php in the root Zepto directory. The config.php file
lists all of the settings and their defaults. To override a setting, simply uncomment it in config.php and set your custom value.
You can override the default Zepto settings (and add your own custom settings) by editing config.php in the root Zepto directory. The config.php file lists all of the settings and their defaults. To override a setting, simply uncomment it in config.php and set your custom value.

### Documentation

For more help have a look at the Zepto documentation at [http://Zepto.dev7studios.com/docs](http://Zepto.dev7studios.com/docs)
For more help have a look at the Zepto documentation [here](https://github.com/hassankhan/Zepto/wiki/Documentation)

0 comments on commit 3424aa1

Please sign in to comment.