Class CanonicalURLHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.url.CanonicalURLHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class CanonicalURLHandlebarsHelper extends BaseHelper
The {{canonicalURL}} handlebars helper is used to output the Canonical URL of the page being published.Usage
The canonicalURL handlebars helper is used to output the Canonical URL of the page being published. This means that in the case of mirrored sections the URL of the source Section will be returned, instead that of the currently publishing mirror.
Example
<link rel="canonical" href="{{canonicalURL}}" />In the above example, the canonical URL for the publishing page is embedded as a link element.
-
-
Constructor Summary
Constructors Constructor Description CanonicalURLHandlebarsHelper(IPageAPI pageApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringapply(Object context, com.github.jknack.handlebars.Options options)Theapplymethod is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
CanonicalURLHandlebarsHelper
@Autowired public CanonicalURLHandlebarsHelper(IPageAPI pageApi)
-
-
Method Detail
-
apply
public String apply(Object context, com.github.jknack.handlebars.Options options)
Description copied from class:BaseHelperTheapplymethod is the main entry point for handlebars.java helpers.It is called internally by the handlebars.java engine when a matching handlebars.java expression is encountered.
- Specified by:
applyin interfacecom.github.jknack.handlebars.Helper<Object>- Specified by:
applyin classBaseHelper- Parameters:
context- The currently executing context.options- The options.- Returns:
- The generated output.
-
-