Voog.com

title

Generates HTML escaped <title>-tag content for the current page, article, or element using an object (page, article) or site-provided title format (page.title_format, page.title_separator) values and object title value. When object nor site values are set and any default values for the tag are not provided then system defaults are used.

Usage:

<title>{% title %}</title>
<meta property="og:title" content="{% title %}">

=> "<title>About - My new site</title>
<meta property="og:title" content="About - My new site">"

Usage with layout defaults (used when object nor site values are set):

<title>{% title default_format="site_page" default_separator=">" %}</title>
=> "<title>My new site &gt;About</title>"

Available attributes

  • format
    • When provided, the user-provided format is ignored (page, article, site).
      Supported placeholders:
      • <page_title> - current page/article/element title.
        <separator> - separator.
        <site_title> - site title value in current language.

        Example:
        <title>{% title format="#### <page_title> #### < <site_title>" %}</title> 
        #=> "<title>#### About #### &lt; My new site</title>"
  • default_separator
    • Default separator value when object nor site title_separator value has been set. System default value is "–".
      Example:
      <title>{% title default_separator="<" %}</title>
      => "<title>About &lt; My new site</title>"
  • default_format
    • Default format when object nor site title_format value has been set.
      Supported values and their corresponding patterns:
      • page_site – <page_title> <separator> <site_title> (system default value)
        site_page – <site_title> <separator> <page_title>
        page – <page_title>
        site – <site_title>
        Example:
          <title>{% title default_format="site_page" %}</title>
        => "<title>My new site – About</title>"
  • separator
    • When provided, the user-provided title separator is ignored (page, article, site).
      Example:
      <title>{% title separator="<" %}</title>
      => "<title>About &lt; My new site</title>"