Skip to content

Commit

Permalink
Syntax highlighting lexer changed from grain to jsp as we are going t…
Browse files Browse the repository at this point in the history
…o use stock pygments

Signed-off-by: Victor Vlasenko <[email protected]>
  • Loading branch information
Victor Vlasenko committed Jan 24, 2014
1 parent dc4edd3 commit 6cbc446
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/latest.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Or this
In both cases 4 will be inserted into the content of the page as the result of evaluation of these Groovy expressions.

To include large blocks of Groovy code one can use notation below:
``` grain:nl
``` jsp:nl
<%
def foo = 2 + 2
%>
Expand Down Expand Up @@ -346,7 +346,7 @@ These variables are reserved:
`page` variable provides access to all the keys of pages YAML headers.

For example to get page title one can use the following code snippet:
``` grain:nl
``` jsp:nl
${page.title}
```

Expand All @@ -370,14 +370,14 @@ they will not be visible to other pages.

`site` variable provides access to all the properties declared in SiteConfig.groovy. For example, in order to get
configured URL of the site one can use this code:
``` grain:nl
``` jsp:nl
<a href="${site.url}">Home</a>
```

`site` also exposes all the pages of the site in `site.pages`, all the asset files of the site
in `site.assets` and both assets and pages in `site.resources`. For example to dump the value of title
defined in every site page one could do:
``` grain:nl
``` jsp:nl
<%= site.pages.collect { it.title } %>
```

Expand All @@ -387,7 +387,7 @@ defined in every site page one could do:
Rendered page content usually wrapped up by layout, where most of the presentation logic is held.

Here is an example of a layout:
``` grain /theme/layout/default.html
``` jsp /theme/layout/default.html
<html>
<head>
<meta charset="utf-8">
Expand All @@ -408,7 +408,7 @@ Please note that rendered page contents is passed in `content` variable to the l

###Layout nesting
One layout can be based on another layout. For example, here is some page layout, based on default layout above:
``` grain /theme/layout/page.html
``` jsp /theme/layout/page.html
---
layout: default
title: "Default page title"
Expand All @@ -426,7 +426,7 @@ Layout nesting can be unlimited.
Common page presentation parts can be kept in separate files and then included into layouts.

For example in the code below sidebar.html is included into layout:
``` grain /theme/layout/page.html
``` jsp /theme/layout/page.html
---
layout: default
title: "Default page title"
Expand All @@ -437,7 +437,7 @@ ${include 'sidebar.html'}

###Passing custom model
In some cases you would want to pass some variables to the included parts:
``` grain /theme/layout/blog.html
``` jsp /theme/layout/blog.html
---
layout: page
---
Expand Down Expand Up @@ -542,15 +542,15 @@ The standard tags are:
1. Resource location

***Example***
``` grain:nl
``` jsp:nl
<link href="${r '/favicon.png'}" rel="icon"> ```
1. **`rs`** - looks up multiple resource URLs by their locations
***Parameters***
1. Resource location list
***Example***
``` grain:nl
``` jsp:nl
<% rs(['/javascripts/libs/jquery.min.js',
'/javascripts/modernizr-2.0.js',
'/javascripts/octopress.js',
Expand All @@ -566,7 +566,7 @@ The standard tags are:
1. *(Optional)* Additional model variables added to `page` map
***Example***
``` grain:nl
``` jsp:nl
${include 'tags.html', [tags: post.categories]} ```
###Custom tag libraries
Expand Down

0 comments on commit 6cbc446

Please sign in to comment.