Enables access to site related information including:
These properties give access to extra features on this object.
Renders statistics service javascript code configured under site settings screen (external tracking code). It is advised to add this property on all page templates at the end of the HTML document. It's rendered into template only in public mode.
<html>
<body>
...
{{ site.analytics }}
</body>
</html>
Site author name.
Returns all visible blogs (not hidden from menu) in the current language environment.
{% for blog in site.blogs %}
<h2>{{ blog.page.title }}</h2>
{% for article in blog.articles %}
{{ article.title }}<br/>
{% endfor %}
{% endfor %}
Site copyright information.
Returns <title> tag separator override value for site used by title tag. When empty then system default ("–") value is used instead.
Returns <title> tag separator value for the site with fallback to system default "–" value.
Returns <title> tag format override value for the site used by title tag. When empty then system default value (page_site
) is used instead.
Supported values and their corresponding patterns:
page_site
– <page_title> <separator> <site_title>
site_page
– <site_title> <separator> <page_title>
page
– <page_title>
Returns <title> tag format patten for the site with fallback to system default (<page_title> <separator> <site_title>
) value.
Returns custom data bound to site.
Returns true
if site has uploaded favicon.
Returns site header in given language. Should be used on the top of the page. Use editable tag to make it editable.
<html>
<body>
<header>{% editable site.header %}</header>
</body>
</html>
Site keywords information.
Returns list of published language environments defined under site settings.
Returns 10 latest blog articles on site. Use latest_n_articles accessor to get appropriate number of articles. Articles are ordered by create date, newer articles first.
Returns requested number of latest articles. Replace n with desirable number. Articles are ordered by create date, newer articles first.
{% for article in site.latest_3_articles %}{{ article.title }}<br>{% endfor %}
{% for article in site.latest_15_articles %}{{ article.title }}<br>{% endfor %}
Returns generic RSS-path for site.
Returns true if user has checked to have a search box on site. The default google search widget can be added as follows:
<head>
<link rel="stylesheet" href="{{ site.static_asset_host }}/libs/edicy-search/latest/edicy-search.css">
</head>
<body>
<form class="search-form">
<input type="search"/>
</form>
<script src="{{ site.static_asset_host }}/libs/edicy-search/latest/edicy-search.js"></script>
<script type="text/javascript">
var search = new VoogSearch($('.search-form').get(0), {
per_page: 3,
lang: '{{ page.language_code }}',
resultsContainer: null, // if given an element results are rendered inside that element instead of modal (with scroll lazy load support)
sideclick: true, // if modal should close on sideclick
mobileModeWidth: 480, // mobile checkpoint (adds class "voog-search-mobile-mode" if <=)
updateOnKeypress: false // updates results on every keypress
});
</script>
</body>
Returns the URL for the static asset server used for serving tools and optional plugins.
See the example above .
Renders header code content configured under site settings screen. It is advised to add this property on all page templates at the end of the HTML head
tag. It's rendered into template only in public mode.
<html>
<head>
...
{{ site.stats_header }}
</head>
</html>
Serializes the site object into a JSON string.
Returns the URL for current site. Mind you, the hostname is taken from the current request, not from the site's primary domain, so depending on which domain you're visiting from, the output is different and will be cached if any changes are made.
{{ site.url }}
=> http://www.voog.com/
Site also behaves as a root menu item and all its child menu items can be accessed in the same manner.
Returns menu item object representing top-level item on site structure, known as "Home page" or landing page.
Returns list of first-level menu items on site including untranslated items.
all_menuitems_with_data - includes page .data attribute.
Returns list of first-level menu items on site.
menuitems_with_data - includes page .data attribute.
Returns all menu items that are hidden. Useful when generating button that groups hidden menuitems together:
{% menubtn site.hidden_menuitems %}
hidden_menuitems_with_data - includes page .data attribute.
Same as menuitems but also returns menu items that are hidden.
menuitems_with_hidden_with_data - includes page .data attribute.
Returns list of first-level untranslated menu items on site.
untranslated_menuitems_with_data - includes page .data attribute.
Returns menu items that are not hidden.
visible_menuitems_with_data - includes page .data attribute.
All these menuitem methods also take an optional suffix _on_level_*
, where * can be a number from 1 to 9. For example, all_menuitems_on_level_2
returns only the second-level menu items.
Returns all blogs in current language environment.
{% for blog in site.blogs %}
<h2>{{ blog.page.title }}</h2>
{% for article in blog.articles %}
{{ article.title }}<br/>
{% endfor %}
{% endfor %}
Return true if site has published articles
Returns 10 latest blog articles on site. Use latest_n_articles accessor to get appropriate number of articles. Articles are ordered by create date, newer articles first.
Returns requested number of latest articles. Replace n with desirable number. Articles are ordered by create date, newer articles first.
{% for article in site.latest_3_articles %}
{{ article.title }}<br/>
{% endfor %}
{% for article in site.latest_15_articles %}
{{ article.title }}<br/>
{% endfor %}
Returns list of published language environments defined under site settings.
Returns true if site has more than one language. Useful for determining visibility of language menu.
Currently only blog articles can be tagged.
Returns true if something has been tagged in site. Parameter is non language specific checking tags over all languages.
Returns list of tag objects on site. Parameter is not language specific returning tags over all languages.
Returns true if something has been tagged in sites current language.
Returns list of tag objects in sites current language.
Example of making a tag cloud that directs to site blog list page:>
{% for tag in site.language_tags %}
<a href="/{{ site.blogs.first.page.path }}/tagged/{{ tag.path }}">{{ tag.name }}</a>
{% endfor %}