From 3424aa1e835c179f29495a12bd893bb0b2bb05b4 Mon Sep 17 00:00:00 2001 From: Hassan Khan Date: Sat, 15 Feb 2014 22:57:25 +0000 Subject: [PATCH] Updated index.md --- content/index.md | 142 ++++++++++++++++++----------------------------- 1 file changed, 54 insertions(+), 88 deletions(-) diff --git a/content/index.md b/content/index.md index fb61e13..db27b12 100644 --- a/content/index.md +++ b/content/index.md @@ -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: - - - - - - - - - - - - -
Physical LocationURL
content/index.md/
content/sub.md/sub
content/sub/index.md/sub (same as above)
content/sub/page.md/sub/page
content/a/very/long/url.md/a/very/long/url
- -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: - -* %base_url% - 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: - -
<ul class="nav">
-	{% for page in pages %}
-	<li><a href="{{ page.url }}">{{ page.title }}</a></li>
-	{% endfor %}
-</ul>
+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 <a> 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)