Skip to content

Files

Latest commit

 

History

History
94 lines (64 loc) · 1.58 KB

additional-tags.md

File metadata and controls

94 lines (64 loc) · 1.58 KB

Additional Tags

The following liquid tags are supplied by the plugin.

pageTitle

Generates the title for a page.

{% pageTitle %}

pageDescription

Generates the description for a page.

{% pageDescription %}

canonicalURL [url]

Generates the canonical URL for the current page or for another page if passing in an argument.

{% canonicalURL %}
{% canonicalURL /feed.xml %}
{% canonicalURL post.url %}

Use without arg to canonical url for current page:

<link rel="canonical" href="{% canonicalURL %}">

Use with arg to link to a specific page, like feed.xml:

<link type="application/atom+xml" rel="alternate" href="{% canonicalURL /feed.xml %}" title="{{ site.title }}" >

Use with Eleventy provided variables, like page.url that resolves to an url in places like...

...feed.liquid:

{% for post in collections.posts limit: 10 %}
  ...
  <link>{% canonicalURL post.url %}</link>
  ...
{% endfor %}

...sitemap.liquid:

{% for item in collections.all %}
  ...
  <loc>{% canonicalURL item.url %}</loc>
  ...
{% endfor %}

metaAuthor

Outputs the full name of the author for the current page.

{% metaAuthor %}

metaRobots

Adds robots meta directive with index,follow except on paginated pages which gets noindex,follow.

{% metaRobots %}

openGraph

Generates block of Open Graph markup for current page.

{% openGraph %}

twitterCard

Generates block of twitter card markup for current page.

{% twitterCard %}