Pico/content-sample/index.md

110 lines
4.6 KiB
Markdown
Raw Normal View History

2012-04-04 13:45:09 +00:00
/*
Title: Welcome
Description: This description will go in the meta description tag
*/
## Welcome to Pico
2012-04-04 13:45:09 +00:00
2014-03-25 15:07:35 +00:00
Congratulations, you have successfully installed [Pico](http://picocms.org/). Pico is a stupidly simple, blazing fast, flat file CMS.
2012-04-04 13:45:09 +00:00
### Creating Content
2012-04-04 13:45:09 +00:00
2015-04-28 23:03:06 +00:00
Pico 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-sample"
folder and that becomes a page. For example, this file is called `index.md` and is shown as the main landing page.
2012-04-04 13:45:09 +00:00
2015-04-28 23:03:06 +00:00
If you create a folder within the content-sample folder (e.g. `content-sample/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-sample/sub/page.md`)
and you will be able to access it from the URL `http://yoursite.com/sub/page`. Below we've shown some examples of content-sample locations and their corresponing URL's:
2012-04-04 13:45:09 +00:00
<table>
<thead>
<tr><th>Physical Location</th><th>URL</th></tr>
</thead>
<tbody>
2015-04-28 23:03:06 +00:00
<tr><td>content-sample/index.md</td><td>/</td></tr>
<tr><td>content-sample/sub.md</td><td>/sub</td></tr>
<tr><td>content-sample/sub/index.md</td><td>/sub (same as above)</td></tr>
<tr><td>content-sample/sub/page.md</td><td>/sub/page</td></tr>
<tr><td>content-sample/a/very/long/url.md</td><td>/a/very/long/url</td></tr>
2012-04-04 13:45:09 +00:00
</tbody>
</table>
2015-04-28 23:03:06 +00:00
If a file cannot be found, the file `content-sample/404.md` will be shown.
2012-04-04 13:45:09 +00:00
### Text File Markup
2012-04-04 13:45:09 +00:00
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:
2014-01-08 16:38:20 +00:00
/*
2012-04-04 13:45:09 +00:00
Title: Welcome
Description: This description will go in the meta description tag
Author: Joe Bloggs
Date: 2013/01/01
2012-04-04 13:45:09 +00:00
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 Pico site
2012-04-04 13:45:09 +00:00
### Themes
2012-04-04 13:45:09 +00:00
You can create themes for your Pico installation in the "themes" folder. Check out the default theme for an example of a theme. Pico uses
2012-04-04 13:45:09 +00:00
[Twig](http://twig.sensiolabs.org/documentation) for it's templating engine. You can select your theme by setting the `$config['theme']` variable
2015-08-01 20:38:14 +00:00
in `config/config.php` to your theme folder.
2012-04-04 13:45:09 +00:00
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:
2015-08-01 20:38:14 +00:00
* `{{ config }}` - Conatins the values you set in `config/config.php` (e.g. `{{ config.theme }}` = "default")
2012-04-04 13:45:09 +00:00
* `{{ base_dir }}` - The path to your Pico root directory
* `{{ base_url }}` - The URL to your Pico site
* `{{ theme_dir }}` - The path to the Pico active theme directory
* `{{ theme_url }}` - The URL to the Pico active theme directory
2015-08-01 20:38:14 +00:00
* `{{ site_title }}` - Shortcut to the site title (defined in `config/config.php`)
* `{{ meta }}` - Contains the meta values from the current page
* `{{ meta.title }}`
* `{{ meta.description }}`
* `{{ meta.author }}`
* `{{ meta.date }}`
* `{{ meta.date_formatted }}`
* `{{ meta.robots }}`
2015-04-28 23:03:06 +00:00
* `{{ content-sample }}` - The content-sample of the current page (after it has been processed through Markdown)
* `{{ pages }}` - A collection of all the content-sample in your site
* `{{ page.title }}`
* `{{ page.url }}`
* `{{ page.author }}`
* `{{ page.date }}`
* `{{ page.date_formatted }}`
2015-04-28 23:03:06 +00:00
* `{{ page.content-sample }}`
* `{{ 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:
2012-04-04 13:45:09 +00:00
<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>
### Plugins
2014-03-25 15:07:35 +00:00
See [http://pico.dev7studios.com/plugins](http://picocms.org/plugins)
### Config
2012-04-04 13:45:09 +00:00
2015-08-01 20:38:14 +00:00
You can override the default Pico settings (and add your own custom settings) by editing `config/config.php` in the Pico directory.
The `config/config.php.template` lists all of the settings and their defaults. To override a setting simply copy
`config/config.php.template` to `config/config.php`, uncomment the setting and set your custom value.
### Documentation
2014-03-25 15:07:58 +00:00
For more help have a look at the Pico documentation at [http://picocms.org/docs](http://picocms.org/docs)