Filename:
index_test_two
Extension:
md
Path:
/index_test_two
BASE URL:
http://jigsaw-test.dev
URL:
http://jigsaw-test.dev/index_test_two
Global Variable:
some global variable
path key in collections.phppath is not specified, permalinks will default to slugified filenameslugify() helper added for easy use in permalink or helper functionsShorthand for easily specifying common permalink structures:
path key can be a string rather than a closure; if it's a string, any bracketed parameters like {filename} will be replaced with values{+filename} will yield the+slugified+filename){date|Y/m/d}, for example, yields 2016/08/29.if no parameters are included, the slugified filename will be appended by default. This allows users to simply specify a collection subdirectory: 'path' => 'posts' will yield item URLs like /posts/the-slugified-filename.
Examples of path shorthand syntax:
'people' yields /people/the-slugified-filename'people/{+filename}' yields ./people/the+slugified+filename'{collection}/{date|Y}/{title}' yields ./people/2016/The Item Title'{collection}/{date|Y/m/d}/{+title}' yields ./people/2016/08/29/the+item+titlevariables key in collections.php:
'posts' => [
'variables' => [
'author' => 'Editorial Staff'
],
...collections.php.sort can contain a single variable name, or an array of multiple variables for a hierarchical sort.+.- for a descending sort order.
'posts' => [
'sort' => '-date',
...
or
'posts' => [
'sort' => ['-date', '+author'],
...$items can reference other collection items using getNext(), getPrevious(), getFirst(), getLast()$item->getNext()->title or $item->getPrevious()->pathextends directive can be omitted from the YAML front matter of a collection's items, allowing for collections that aren't tied to a particular template. See the "People" collection for an example.@foreach ($people->sortBy('age') as $person) or $products->sum('price')config.php or collections.php:
@foreach ($products->sortByDesc(function ($data) { return $data->priceWithTax(); })getContent().$pagination->first, last, currentPage, totalPages$pagination->pages can be iterated over to build numeric page links (1 | 2 | 3), or individual pages can be referenced as $pagination->pages[1]collections.php under the helpers => [] key are available within Blade templates for a collection item; previously, they were only available in an index template when iterating over a collection.config.php and referenced in any Blade template as $functionName($parameter)filename displays current page's filename (without extension)extension displays current page's file extension (e.g. md, blade.php, etc.)path is path to current page, relative to site rooturl concatenates the site base url (if specified in config.php) with path for fully-qualified url to current pagecollection displays the name of the collection an item belongs to.blade.md extension will be processed first by Blade, before the markdown is parsed.@include markdown files as partials (which will be parsed). Addresses feature request https://github.com/tightenco/jigsaw/issues/62.blade.md support described above, other non-HTML, text-type files can be processed with Blade first, including .blade.js, .blade.json, .blade.xml, .blade.rss, .blade.txt, and .blade.text. After the file is first processed by Blade, the resulting file will maintain its filetype extension in the URL (e.g. some-file.blade.xml will become the URL /some-file.xml).extends parameter in the YAML front matter. This creates one URL for each template, allowing, for example, a collection item to have /web/item and a /api/item endpoints, or /summary and /detail views.collections.php, permalink structures can be specified uniquely for each template type: 'path' => [
'web' => 'people/{date|Y-m-d}/{+filename}',
'api' => 'people/api/{date|Y-m-d}/{+filename}'
]
config.php are accessed with the $config-> namespace, e.g. $config->some_variable or $config->someFunction()collections.php are referenced by their name, with no prefix. A collection named posts would be referenced as $posts, e.g. $posts->first()->path$item, e.g. $item->author or $item->excerpt()people can be referenced as $person->first_name. $person->first_name and $item->first_name will return the same thing. (If a collection name's plural and singular are the same, this shorthand won't be available; so a collection of $sheep is out of luck.)bootstrap.php file, providing the ability to customize bindings (for extending the markdown parser, for instance) has been updated (from https://github.com/tightenco/jigsaw/pull/68)