Browse Source

Added comment and documentation about meta keys parsing.

Konstantin Pavlov 12 năm trước cách đây
mục cha
commit
e31b90ee70
2 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 5 1
      content/index.md
  2. 1 1
      lib/pico.php

+ 5 - 1
content/index.md

@@ -44,6 +44,8 @@ At the top of text files you can place a block comment and specify certain attri
 	Author: Joe Bloggs
 	Date: 2013/01/01
 	Robots: noindex,nofollow
+	Keywords: keyword1, keyword2
+	Foo: Bar
 	*/
 
 These values will be contained in the `{{ meta }}` variable in themes (see below).
@@ -66,13 +68,15 @@ All themes must include an `index.html` file to define the HTML structure of the
 * `{{ theme_dir }}` - The path to the Pico active theme direcotry
 * `{{ theme_url }}` - The URL to the Pico active theme direcotry
 * `{{ site_title }}` - Shortcut to the site title (defined in config.php)
-* `{{ meta }}` - Contains the meta values from the current page
+* `{{ meta }}` - Contains the meta values from the current page. Meta keys are always converted to lowercase.
 	* `{{ meta.title }}`
 	* `{{ meta.description }}`
 	* `{{ meta.author }}`
 	* `{{ meta.date }}`
 	* `{{ meta.date_formatted }}`
 	* `{{ meta.robots }}`
+	* `{{ meta.keywords }}`
+	* `{{ meta.foo }}`
 * `{{ 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 }}`

+ 1 - 1
lib/pico.php

@@ -138,7 +138,7 @@ class Pico {
 	}
 
 	/**
-	 * Parses the file meta from the txt file header
+	 * Parses the file meta from the txt file header. Meta keys are converted to lowercase automatically.
 	 *
 	 * @param string $content the raw txt content
 	 * @return array $headers an array of meta values